PDA

View Full Version : wrong syntax



urgido
08-23-2006, 06:45 PM
I tried to executed the below code, but something is wrong, Can somebody tell me what's wrong?


INSERT INTO country VALUES (1, 'AE');
INSERT INTO country VALUES (2, 'AF');
INSERT INTO country VALUES (3, 'AG');

mic2100
08-23-2006, 09:06 PM
when ever i do an insert i first define which fields the data is going to be written to. Like this...


INSERT INTO country (id, country) VALUES (1, 'AE');
INSERT INTO country (id, country) VALUES (2, 'AF');
INSERT INTO country (id, country) VALUES (3, 'AG');

urgido
08-23-2006, 09:28 PM
error:


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 '; INSERT INTO country (id, country) VALUES (6, 'AL')' at line 1

mic2100
08-23-2006, 09:35 PM
is bm60_staaten the name of ur table where all the countries are stored???

mic2100
08-23-2006, 09:42 PM
did it enter the values before this into the db if so i could be a problem with that specific INSERT statement????

Kid Charming
08-23-2006, 09:55 PM
Are you sending all three queries through one PHP mysql_query() call, by chance?

urgido
08-23-2006, 10:00 PM
sorry I edit and save the changes. The name is Country the other name is based on helo in other forum. hehehe