Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Is there any special way for variable++?
October 22, 2005, 10:51 am
rate this thread
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)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
Re: Is there any special way for variable++?
Generally, it's a bad idea to give a column a name that is also a sql
preserved word (count).
No, you would let the database do the work:
UPDATE Tablename SET count=count+1 WHERE id=2
May need `` around count, because of problem mentioned above. See
Yes, that operator also exists in PHP:
- » ssh on command line: force using a group size (prime size) of 1024 (and no...
- — The site's Newest Thread. Posted in » Secure Shell Forum