hi, wondering if someone could provide a little help, i have found a basic free script that generates a bar chart and needs its data like :
$aGraphData = Array
(array('Apples', 25, 'f'),
array('Oranges', 50, 'f'),
array('Limes', 15, 'f'),
array('Grapes', 11, 'f'),
array('Mangos', 32, 'f'),
array('Bannans', 17, 'f'),
array('Star Fruits', 32, 'f'),
array('Pears', 10.5, 'f'),
array('Plums', 10, 'f'),
array('Peaches', 5, 'f'),
);
etc .. so how do i sum up the data in the database for example after ive selected all the data .. "$apples = where FIELD contains "apples" add up the number of times" that dosent really make a lot of sense hopefully someone can understand what i mean? or if they have any suggestions for generating reports form mysql data.
Thanks
edit: i figured this way to do it.
$numresults = mysql_query("SELECT `bairport`
FROM `bookings`
WHERE `bairport` LIKE 'birmingham'"); // the query.
$airport = mysql_num_rows($numresults); // Number of rows returned from above query.
is there a way to have it all under one query for each term like "manchester,birmingham, etc..) or do i have to have a differeny query for each one?