Jump to content

count up all numbers in a column


jasonc

Recommended Posts

$count = mysql_query("SELECT count(numbers) from `info`");

 

you want to use SUM

 

$count = mysql_query("SELECT SUM(numbers) from `info`");

 

i changed to what you had but it did not work it shows an error about a resource id #6

 

i thought maybe i had not got the field set correctly but i think it is, it is set to

int(11)

 

maybe it is this part which is wrong....

 

echo($count);

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.