MyBB Community Forums

Full Version: mySQL Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to make something. Whats wrong with this?
Quote:SELECT *
FROM darkrp_privs
WHERE 1
UPDATE darkrp_privs
SET "admin" = 1
WHERE steam = "STEAM_TEST"
Yes I have the table with admin vip and steam fields in it.
The error is
Quote:#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UPDATE darkrp_privs SET "admin" = 1 WHERE steam = "STEAM_TEST" LIMIT 0, 30' at line 4
You've put the speech marks around the wrong item in the SET command. Try this:
UPDATE darkrp_privs SET admin="1" WHERE steam="STEAM_TEST"
It didn't work. But thats good to know. Thanks.
Same Error

UPDATE darkrp_privs SET admin=1 WHERE steam='STEAM_TEST';
Same Error....
MySQL Server version: 5.1.36-community-log
PHPmyAdmin Version information: 3.2.0.1
Can understand from your first query what you're doing. Why are you putting an update after a select like that?? That isn't valid SQL.
(2010-09-18, 08:13 PM)MattRogowski Wrote: [ -> ]Can understand from your first query what you're doing. Why are you putting an update after a select like that?? That isn't valid SQL.

This. What would be the reason for selecting a row, if you've told it to update ( which finds the row anyway as you used where)