PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Could someone help me out. How can i get a sum of certain values in a while-loop. I pull out the values from MySQL and then loop thru values and print them.
then i print the values. Now i need to get a sum of all values in one field. Like if you had a shopping cart displayed, where all values are listed in rows and below them is the total. I need tho do this with php, not in SQL statement.
posting more code may help. If the loop just sums the data or other circumstances, it may be possible to have mysql do it for you. You obviously didn't post the entire loop. I'd like to see the query as well.