Forum Moderators: open

Message Too Old, No Replies

sql syntax

arrrgh

         

madmatt69

5:30 pm on Oct 6, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hey all,

Any ideas as to what's wrong with the following query? Mysql just doesn't give me any info other than 'syntax error'.

UPDATE users WHERE user_id = 4416 SET user_img = 'us.gif'; 

Demaestro

5:36 pm on Oct 6, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



the where clause has to come after the set clause.

UPDATE users SET user_img = 'us.gif' WHERE user_id = 4416;

LifeinAsia

5:38 pm on Oct 6, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



'cause there's an error in the syntax. :)

Try:
UPDATE users
SET user_img = 'us.gif'
WHERE user_id = 4416;

madmatt69

5:45 pm on Oct 6, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ha, figures...Thanks guys!