Sum from Arrays ?
| From: | Keith Whyman | Date: | Wed, 07 Feb 2001 17:15:37 +0000 |
| Subject: | Sum from Arrays ? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-38571@lists.php.net to get a copy of this message | ||
It's probably a stupid question but...........
I've got the following ;
SELECT t_category_name COUNT(*) AS count
FROM t_city,t_zipcodecity,t_location,t_category , t_locationcategory
WHERE (t_category_id_category = t_locationcategory_id_category)
AND (t_location_id_location = t_locationcategory_id_location)
AND (t_zipcodecity_zipcode = t_location_zipcode)
AND (t_city_id_city = t_zipcodecity_id_city)
AND (t_city_id_city = 1)
AND ((t_location_sex = 4) OR (t_location_sex = 0))
GROUP BY t_category_name";
$result1 = mysql_db_query(DBWEB, $query);
print mysql_error();
echo "
<TABLE width=\"100%\">
";
if ($result1) {
while ($r = mysql_fetch_array($result1)) {
$numbers = $r["count"];
$names =$r["$t_category_name"];
And what I want is a total for my count - I think it something to do with
the mySQL sum funktion but I've got a bit stuck !