Add All Together - PHP & MySQL
Posted: Wed Mar 16, 2011 1:53 pm
Hi Guys,
I need some advice please. In my database table called 'affleads' i have a row called Payout. Now below is the following MySQL code i am using on my PHP script:
Now lets say there are 6 records matching the SQL query as the following:
[text]2.50
2.34
1.85
2.74
1.00
2.07[/text]
What PHP code would i use in order to get the values of Payout and then Add them all together and save the value to a variable?
Any help would be great and thank you in advance.
Thanks!
I need some advice please. In my database table called 'affleads' i have a row called Payout. Now below is the following MySQL code i am using on my PHP script:
Code: Select all
$query = "SELECT Payout FROM affleads WHERE AffID ='$affid'";[text]2.50
2.34
1.85
2.74
1.00
2.07[/text]
What PHP code would i use in order to get the values of Payout and then Add them all together and save the value to a variable?
Any help would be great and thank you in advance.
Thanks!
