SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Query error

  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2004
    Location
    Uruguay
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking Query error

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

    Code:
    mysql_query("UPDATE imagen SET orden IN(".$losVal.") WHERE PicNum LIMIT 1")
    this is the output error:
    Code:
    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

  2. #2
    does not play well with others frezno's Avatar
    Join Date
    Jan 2003
    Location
    Munich, Germany
    Posts
    1,391
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The IN is incorrect because you have to use a SET fieldname = value
    Take a look her at the UPDATE syntax

    Perhaps you want say by words what you want to achieve and then we can find a solution (or not)
    We are the Borg. Resistance is futile. Prepare to be assimilated.
    I'm Pentium of Borg.Division is futile.Prepare to be approximated.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •