How to fix error: #1064 - You have an error in your SQL syntax;

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Taylor Colpitts

    How to fix error: #1064 - You have an error in your SQL syntax;

    I received #1064 - 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 'WHERE customer_id=1' at line 1

    My query is:

    INSERT INTO customers (mce) VALUES ('I like apples') WHERE customer_id=1

    Any ideas?
  • mwasif
    Recognized Expert Contributor
    • Jul 2006
    • 802

    #2
    INSERT is used to add new records to the table. If you want to modify an existing record, use UPDATE statement instead e.g.
    [CODE=mysql]UPDATE customers SET
    mce = 'I like apples'
    WHERE customer_id=1[/CODE]

    Comment

    Working...