meinenr

meinenr

  • NA
  • 99
  • 21.1k

Mysql change values

Sep 29 2012 2:32 PM
Hey everybody,
Does somebody know How I can change values in a line in my database table?

EXAMPLE:

My Databese Table:
No
Username
Tickets
1
User1
3
2
User2
1


NOW: The User2 gets 4 tickets more.

So i have to ask how much tickets he have NOW, and than i have to add 4 tickes.
So he have 5 tickes.

1. Get the line, where 'Username' = 'User2'
2. Get the value of the column 'Tickets' of the line where 'Username' = 'User2'
3. add 4 tickets to the value of the column 'Tickets' of th line where 'Username' = 'User2'


But how I can do it?


Answers (57)