Page 1 of 1

Update query

Posted: Tue May 30, 2006 12:18 pm
by a94060
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.

Re: Update query

Posted: Tue May 30, 2006 1:25 pm
by Christopher
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'";

Posted: Tue May 30, 2006 2:27 pm
by a94060
ok,thanks