SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Thread: Help With This Query
-
Jun 3, 2008, 21:27 #1
- Join Date
- Aug 2003
- Location
- Southern California, United States
- Posts
- 1,616
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Help With This Query
UPDATE `top_site_users` SET out = out+1 WHERE user_id = '1' AND top_site_id = '1' AND id = '1'
It has something to do with out = out + 1 I just can't grasp it. phpMyAdmin says its around that area.Have a good day.
-
Jun 3, 2008, 21:55 #2
- Join Date
- Jul 2002
- Location
- Toronto, Canada
- Posts
- 39,347
- Mentioned
- 63 Post(s)
- Tagged
- 3 Thread(s)
is there any chance that OUT might be a reserved word?
try putting it in backticks -- this `escapes` it and treats it like an identifier, i.e. column name
note that you do not need the backticks around top_site_users, because that isn't a reserved word, nor does it contain any special characters (the other reason that backticks are sometimes needed)
oh, and by the way, please don't compare your numeric columns to strings
change this --
... WHERE user_id = '1' AND top_site_id = '1' AND id = '1'
to this --
... WHERE user_id = 1 AND top_site_id = 1 AND id = 1
-
Jun 3, 2008, 21:57 #3
- Join Date
- Aug 2003
- Location
- Southern California, United States
- Posts
- 1,616
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Ah thanks thats what I had forgotten
Have a good day.
Bookmarks