Page 1 of 1

UPDATE query

Posted: Thu Apr 14, 2005 6:54 am
by pella.d
i seem to be not be able to get this to work.
Any help would be great thanks.

Code: Select all

UPDATE newstest 
SET('subject', 'date', 'content') 
VALUES('$editSubject', '$editDate', '$editContent') 
WHERE id=$editRow LIMIT 1

Posted: Thu Apr 14, 2005 7:01 am
by Sphen001
Hi,

Try putting the $editRow in single quotes.

Sphen001

Posted: Thu Apr 14, 2005 7:04 am
by pella.d
Still wont work.

Posted: Thu Apr 14, 2005 7:10 am
by n00b Saibot
Your SQL is wrong! This will work...

Code: Select all

UPDATE newstest
SET `subject`='$editSubject', `date`='$editDate', `content`='$editContent'
WHERE id=$editRow LIMIT 1

Posted: Thu Apr 14, 2005 7:10 am
by pella.d
Well that did it,
thank you kindly.

How come the copy i had didnt work? I took it right from mysql.com