|
Posted by typingcat on 10/22/05 13:51
Say I have a table in a MySQL server
ID USERNAME COUNT
0 JOHN 2
1 JANE 3
2 HOMER 3
3 MOE 2
If I want to increase Homer's count by 1,
The plain way would be;
1)$TEMP=SELECT COUNT WHERE ID=2
2)$TEMP++
2)UPDATE .. SET COUNT=$temp...
I guess if there is any special way to increase the int value by one?
For increasing 1 is so commonly used (that's why c,c++,java,C# has the
operator ++).
Navigation:
[Reply to this message]
|