Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-23-2006, 06:45 PM   PM User | #1
urgido
Regular Coder

 
Join Date: Aug 2005
Posts: 257
Thanks: 8
Thanked 0 Times in 0 Posts
urgido is an unknown quantity at this point
wrong syntax

I tried to executed the below code, but something is wrong, Can somebody tell me what's wrong?

PHP Code:
INSERT INTO country VALUES (1'AE');
INSERT INTO country VALUES (2'AF');
INSERT INTO country VALUES (3'AG'); 
urgido is offline   Reply With Quote
Old 08-23-2006, 09:06 PM   PM User | #2
mic2100
Regular Coder

 
mic2100's Avatar
 
Join Date: Feb 2006
Location: Scunthorpe
Posts: 562
Thanks: 15
Thanked 28 Times in 27 Posts
mic2100 is on a distinguished road
when ever i do an insert i first define which fields the data is going to be written to. Like this...
Code:
INSERT INTO country (id, country) VALUES (1, 'AE'); 
INSERT INTO country (id, country) VALUES (2, 'AF'); 
INSERT INTO country (id, country) VALUES (3, 'AG');
mic2100 is offline   Reply With Quote
Old 08-23-2006, 09:28 PM   PM User | #3
urgido
Regular Coder

 
Join Date: Aug 2005
Posts: 257
Thanks: 8
Thanked 0 Times in 0 Posts
urgido is an unknown quantity at this point
error:

Code:
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

Last edited by urgido; 08-23-2006 at 09:59 PM..
urgido is offline   Reply With Quote
Old 08-23-2006, 09:35 PM   PM User | #4
mic2100
Regular Coder

 
mic2100's Avatar
 
Join Date: Feb 2006
Location: Scunthorpe
Posts: 562
Thanks: 15
Thanked 28 Times in 27 Posts
mic2100 is on a distinguished road
is bm60_staaten the name of ur table where all the countries are stored???
mic2100 is offline   Reply With Quote
Old 08-23-2006, 09:42 PM   PM User | #5
mic2100
Regular Coder

 
mic2100's Avatar
 
Join Date: Feb 2006
Location: Scunthorpe
Posts: 562
Thanks: 15
Thanked 28 Times in 27 Posts
mic2100 is on a distinguished road
did it enter the values before this into the db if so i could be a problem with that specific INSERT statement????
mic2100 is offline   Reply With Quote
Old 08-23-2006, 09:55 PM   PM User | #6
Kid Charming
Regular Coder

 
Join Date: Jun 2005
Posts: 804
Thanks: 0
Thanked 0 Times in 0 Posts
Kid Charming is an unknown quantity at this point
Are you sending all three queries through one PHP mysql_query() call, by chance?
Kid Charming is offline   Reply With Quote
Old 08-23-2006, 10:00 PM   PM User | #7
urgido
Regular Coder

 
Join Date: Aug 2005
Posts: 257
Thanks: 8
Thanked 0 Times in 0 Posts
urgido is an unknown quantity at this point
sorry I edit and save the changes. The name is Country the other name is based on helo in other forum. hehehe
urgido is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:38 PM.


Advertisement
Log in to turn off these ads.