0
votes

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');
4

4 Answers

2
votes

You're missing the Table Name. Try:

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

are ping and order text fields or numeric? if numeric remove the ticks from the 1's

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

could also be reserved word try:

INSERT INTO Tablename (country,`ping`,`order`) VALUES ('China',1,1)
2
votes

Your insert statement is missing the table name:

INSERT INTO tbl_name (col_name,...) VALUES (expr,...)
0
votes

you are missing table name. also make sure that those quotes are necessary