Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
a94060
Forum Regular
Posts: 543 Joined: Fri Feb 10, 2006 4:53 pm
Post
by a94060 » Tue May 30, 2006 12:18 pm
Hi,
I was wondering if i had written this query correctly (i would have tested,but i am not at my home right now.)
Code: Select all
"UPDATE poffers WHERE id=$entry SET status=rejected";
It seems right,just want to know.
Christopher
Site Administrator
Posts: 13596 Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US
Post
by Christopher » Tue May 30, 2006 1:25 pm
In SQL the order of the different parts of the statement is important. You also need to put single quotes around all values that are not numbers (such as 'rejected'). It should be:
Code: Select all
"UPDATE poffers SET status='rejected' WHERE id='$entry'";
(#10850)
a94060
Forum Regular
Posts: 543 Joined: Fri Feb 10, 2006 4:53 pm
Post
by a94060 » Tue May 30, 2006 2:27 pm
ok,thanks