UPDATE query with calculatons and variables.
Posted: Mon Aug 31, 2009 6:39 pm
Finally on the final stage of building my website
But with this comes a new part to learn and im stuck on the first hurdle, i have tried to do this my self for a day but now i have run out of paitence and come here.
Basically its to do with money/intergers and users with a bit of calclation. What im trying to do is when user clicks "accept" they will be forwarded to "processing.php" Now the calculations start,
First problem how will i get the user id where the money is being sent to when its not the current user thats a big headache for me... But this is what i done so far.
$perperson = money to add
But then the $perperson is a problem in it self because $perperson value changes depending on the job_id what is used so i got another headache there.
Just need some help basically in the theory/process i need to use to get intergers added to a user
Basically its to do with money/intergers and users with a bit of calclation. What im trying to do is when user clicks "accept" they will be forwarded to "processing.php" Now the calculations start,
First problem how will i get the user id where the money is being sent to when its not the current user thats a big headache for me... But this is what i done so far.
$perperson = money to add
Code: Select all
$sql = "UPDATE users set user_money = user_money + $perperson WHERE user_id = dont know how to get id of user";Just need some help basically in the theory/process i need to use to get intergers added to a user