Page 1 of 1
PHP Addition
Posted: Tue Oct 09, 2007 8:32 pm
by 4Boredom
I am trying to make a variable addition code like this
Code: Select all
$addedvalue = 5;
$mysqlvalue + $addedvalue = $totalvalue;
print($totalvalue);
totalvalue has been displaying as 0. It should not display as 0.
anyone know how to fix this
Posted: Tue Oct 09, 2007 9:01 pm
by superdezign
Code: Select all
$totalvalue = $mysqlvalue + $addedvalue
Assignment always works in the order that whatever's on the left of the assignment operator (=) is given the value of whatever's on the right of it.
Posted: Tue Oct 09, 2007 9:11 pm
by 4Boredom
ok but now its counting like this
19 = 0 + 10
the result should be 10
Posted: Tue Oct 09, 2007 11:32 pm
by 4Boredom
so yeah the first rowset is adding 9 to the result... the next is adding 10... the next 11... what is going on.. ahhhhh lol
Posted: Tue Oct 09, 2007 11:51 pm
by Kieran Huggins