Search code examples
sqlmysqlmysql-error-1064

mysql error 1064 when inserting


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 '(country,ping,order) VALUES (China,1,1)' at line 1

this is my code

INSERT INTO  
  (country, ping, order) 
VALUES 
  ('China', '1', '1');

Solution

  • You're missing the Table Name. Try:

    INSERT INTO MYTABLENAME (country,ping,order) VALUES ('China','1','1');