Hi
I have a database that holds data regarding registered members, this includes an amount of credits within a users account.
What I want to do is quickly updatethe users credits when they purchase some more.
I know i could do that by first finding out the users current credit amount from a query, put that into a variable, then add the new credit amount to the current balance to make a new varibale and then run another query to update the users record.
However I was wondering out of interest if all this could be achieved through one query or perhaps less code?
thanks in advance
Updating an amount
Moderator: General Moderators
Code: Select all
update users set credits = credits+10000 where user_id = '1';