ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am trying to execute the following MySQL code but I am getting and error and I dont understand why!
Code:
INSERT INTO holiday_regions VALUES ('brittany','Brittany',0);
INSERT INTO holiday_regions VALUES ('normandy','Normandy',1);
INSERT INTO holiday_regions VALUES ('picardie','Picardie',2);
INSERT INTO holiday_regions VALUES ('nord','Nord - Pas de Calais',3);
INSERT INTO holiday_regions VALUES ('champ','Champagne - Ardenne',4);
INSERT INTO holiday_regions VALUES ('ile','Ile de France',5);
INSERT INTO holiday_regions VALUES ('lorra','Lorraine',6);
INSERT INTO holiday_regions VALUES ('alsa','Alsace',7);
INSERT INTO holiday_regions VALUES ('franc','Franche Comté',8);
INSERT INTO holiday_regions VALUES ('burgu','Burgundy',9);
INSERT INTO holiday_regions VALUES ('centre','Centre',10);
INSERT INTO holiday_regions VALUES ('pays','Pays de la Loire',11);
INSERT INTO holiday_regions VALUES ('poit','Poitou - Charentes',12);
INSERT INTO holiday_regions VALUES ('limo','Limousin',13);
INSERT INTO holiday_regions VALUES ('auver','Auvergne',14);
INSERT INTO holiday_regions VALUES ('rhone','Rhône - Alps',15);
INSERT INTO holiday_regions VALUES ('prove','Provence - Alps - Cóte d Azur',16);
INSERT INTO holiday_regions VALUES ('lang','Languedoc - Roussillon',17);
INSERT INTO holiday_regions VALUES ('midi','Midi - Pyrénéés',18);
INSERT INTO holiday_regions VALUES ('aquit','Aquitaine',19);
INSERT INTO holiday_regions VALUES ('cors','Corsica',20);
and here is the error
Quote:
You have an error in your SQL syntax near '; INSERT INTO holiday_regions VALUES ('normandy','Normandy',1); INSERT INTO holi' at line 1
Can someone explain what that error means? It seems to be a bit ambigious. Is it near to the start or end on the quote. MySQL really need some more detailed debugging system!
is the third field in your table set to contain a character ..or a number? if it's a character ..you may need the " ' "s (quotes) ...also you can set that field for the number to auto_increment so you can just leave it out altogether (but it should be an integer field first)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.