Forums

Show value from database

flyboeing 29 Feb, 2012
Helo all,

I am making a database with all the deliveries of aircrafts. I used the profile page to make a list per month.
In the screenshot below you see on the left side the type of aircraft, the column next to it shows the number of that type that is delivered and in the column on the right I want all the different airlines.


In my MYSQL-database I have the following:


In the last column I would like to have (if you look at the screenshot above) the airline name and the amount that has been delivered behind it (for example: TUI Travel PLC (2x)).

I hope someone can help me with this🙂
GreyHead 29 Feb, 2012
Hi flyboeing,

Quick answer

In the Header box put
<?php
global $total;
$total = 0;
?>

In the Body box put
<?php
global $total;
$total += $MyRow->aantal;
?>

In the Footer box put
<?php
global $total;
echo $total;
?>


Bob
flyboeing 02 Mar, 2012
Thanks for your help Bob!

Do you know a way to fix the second problem I have?
GreyHead 02 Mar, 2012
Hi flyboeing,

The simplest answer is to add a MySQL query into the Body box to get the count for that row.

The 'better' answer would be to construct a more complex query when the list is first built but CCv3 doesn't make that easy.

Bob
This topic is locked and no more replies can be posted.