Question

Hi i cant figure out this.. i even try direct in phpmyadmin

this query is not working

UPDATE orsil_quote SET status=4 WHERE order=199

Direct on Php Myadmin i get MySQL said: #1064 (syntax error around order=199)

I have tried

 UPDATE orsil_quote SET status=`4` WHERE order=`199`
 UPDATE `orsil_quote` SET status=4 WHERE order=199
 UPDATE `orsil_quote` SET status=`4` WHERE order=`199`

 UPDATE orsil_quote SET status='4' WHERE order='199'
 UPDATE 'orsil_quote' SET status=4 WHERE order=199
 UPDATE 'orsil_quote' SET status='4' WHERE order='199'

 UPDATE orsil_quote SET status="4" WHERE order="199"
 UPDATE "orsil_quote" SET status=4 WHERE order=199
 UPDATE "orsil_quote" SET status="4" WHERE order="199"

I can confirm the column orsil_quote does exists, also column status and column order, all of them exists and the name has been checked hundred times.

What is happening!!

Était-ce utile?

La solution

ORDER is a reserved MySQL keyword. If you are going to use it as a column identifier you must wrap it in ticks:

UPDATE `orsil_quote` SET `status`=4 WHERE `order`=199

Although it would be better to alter your table and not use a reserved keyword as a column identifier.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top