I am trying to do an INSERT statement. It is giving me an error #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 'Telecaster’, 599.00)' at line 1

Here is the statement: INSERT INTO gtr_shop1_products (categoryID, productCode, productName, listPrice) VALUES (1, ‘tele’, ‘Fender Telecaster’, 599.00);

What am I doing wrong?

5 Years
Discussion Span
Last Post by thilipdilip

Hello - I'm not sure what your db looks like, but you if your CategoryID is set as Auto-Increment you don't have to include it in your statement. I like to test my sql in something like Sql Query Browser before I try it in my application. Hth.


when you exectute this query in php then write in this way
mysql_query("//Your query goes here") or die(mysql_error());
this will give you exact error. do this and let me know what error is being reported

    Your query syntax working fine you made small mistake when using symbol ' instesd of this symbol you used some other symbols  
    I changed the your syntax check with thatm 
     INSERT INTO gtr_shop1_products (categoryID, productCode, productName, listPrice) VALUES (1, 'tele', 'Fender Telecaster', 599.00);     
     this is working fine
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.