Hey i have a select statement like:
"SELECT *, SUM(calls) FROM tablename"
but... will it work? I mean i try using mysql_fetch_row and _fetch but always get errors... If this can be done this way, can someone show me how i would go about getting the value of SUM(calls)??
Thanks!
MySQL SUM() question
Moderator: General Moderators
Code: Select all
$sql = "SELECT SUM(calls) AS total FROM tablename";
$res = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_assoc($res);
echo 'Total : '.$row['total'];-
Illusionist
- Forum Regular
- Posts: 903
- Joined: Mon Jan 12, 2004 9:32 pm