UPDATE query

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
pella.d
Forum Newbie
Posts: 11
Joined: Mon Apr 11, 2005 3:05 am

UPDATE query

Post 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
Sphen001
Forum Contributor
Posts: 107
Joined: Thu Mar 10, 2005 12:24 pm
Location: Land of the Beaver

Post by Sphen001 »

Hi,

Try putting the $editRow in single quotes.

Sphen001
pella.d
Forum Newbie
Posts: 11
Joined: Mon Apr 11, 2005 3:05 am

Post by pella.d »

Still wont work.
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post 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
pella.d
Forum Newbie
Posts: 11
Joined: Mon Apr 11, 2005 3:05 am

Post 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
Post Reply