Query error

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
ratamaster
Forum Newbie
Posts: 23
Joined: Fri Oct 15, 2004 6:36 am

Query error

Post by ratamaster »

I want to UPDATE a table called "imagen", the values from the column "orden", but I'm making something worng:

Code: Select all

mysql_query("UPDATE imagen SET orden IN(".$losVal.") WHERE PicNum LIMIT 1")
this is the output error:

Code: Select all

You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'IN 9,1 WHERE PicNum LIMIT 1' at line 1
Someone knows how can I fix the query?


Alvaro
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

Code: Select all

UPDATE table SET field = 'new value' WHERE some_field = 'some value' LIMIT 1;
Post Reply