LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-01-2003, 05:30 PM   #1
pnh73
Member
 
Registered: Jul 2003
Location: Birmingham, UK
Distribution: Ubuntu,Debian
Posts: 381

Rep: Reputation: 30
Why MySQL Error on INSERT INTO....?


Hi,

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!

TIA
 
Old 11-01-2003, 05:39 PM   #2
jhorvath
Member
 
Registered: Sep 2002
Location: OH, USA
Distribution: 2.6.16-1.2096_FC5 #1
Posts: 245

Rep: Reputation: 30
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)

Last edited by jhorvath; 11-01-2003 at 05:46 PM.
 
Old 11-01-2003, 05:53 PM   #3
pnh73
Member
 
Registered: Jul 2003
Location: Birmingham, UK
Distribution: Ubuntu,Debian
Posts: 381

Original Poster
Rep: Reputation: 30
it is mediumint(4)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
segmentation fault when insert data into mysql torontosmallbird Other *NIX 1 08-07-2005 07:13 AM
php mysql insert null value spoody_goon Programming 2 03-28-2004 10:20 AM
I need to insert and post PHP MYSQL DropHit Programming 2 02-18-2004 11:21 PM
Mysql insert problem don_dimo Linux - Software 3 11-01-2003 09:27 PM
Insert Data by FORM in MYSQL gruger Linux - Software 0 07-16-2003 12:50 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration