Page 1 of 1
MySQL/PHP Question
Posted: Tue Oct 07, 2003 4:27 am
by atomix
ok say that i have a column in my table that has a list of download counts, how would i make a php/mysql query to count up all the numbers for each row into 1 full number aka the total download count?
Posted: Tue Oct 07, 2003 5:17 am
by Wayne
It depends if you just want to know how many records :
Code: Select all
SELECT COUNT(*) FROM table_name WHERE ....
or if you have values on each record that you want to total up :
Code: Select all
SELECT SUM(*) FROM table_name WHERE ....
then add on your WHERE clause to limit it to the specific details you want or leave it off for all the records.
Posted: Tue Oct 07, 2003 5:34 am
by atomix
thanks so much

Posted: Tue Oct 07, 2003 8:49 am
by nigma
If you read these two tutorials I am sure you will find out that there are many other things you can do with mySQL that could simplify your life in the future.
http://www.devshed.com/Server_Side/MySQL/Speak/