This is a discussion on Getting SUM Function Result within the SQL Server forums, part of the Microsoft SQL Server category; --> Hello, In the project I'm working on, I need to add up all rows data for one column. So, ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hello, In the project I'm working on, I need to add up all rows data for one column. So, I have this code: $getprodcount = mysql_query("SELECT SUM(qty) FROM purchase"); $numproducts=$getprodcount; Later on, I have this code: <?php print $numproducts; ?> What is being printed is Resource id #5...not the numeric value of what is supposed to be a sum. What is wrong? I am assuming taht resource id #5 is a pointer of some sorts to the number I am looking for, but how do you get the actual sum number? Thanks in advance! -- Message posted via http://www.sqlmonster.com |