Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> MySQL
Author Message
express
Client



Joined: Jan 03, 2007
Posts: 94

PostPosted: Sat Dec 26, 2009 11:51 am Reply with quote

Hi all,

I had 3 seperate sql files to import to my db. 2 of them imported just fine. One I keep getting an error message and I cannot figure it out.

Here is the sql file I am trying to import along with the error message I receive.

....Error....

SQL query:

CREATE TABLE badc_host_slots(
slot VARCHAR( 30 ) ,
STATUS INT( 1 ) ,
task INT( 1 ) ,
hlname VARCHAR( 30 ) ,
army INT( 1 ) ,
epoca INT( 10 ) ,
date DATE,
time TIME,
max_human INT( 2 ) ,
tgt_name VARCHAR( 50 ) ,
fig_attk_nbr INT( 2 ) ,
fig_def_nbr INT( 2 ) ,
bomb_attk_type VARCHAR( 50 ) ,
bomb_attk_nbr INT( 2 ) ,
bomb_attk_ai INT( 1 ) ,
bomb_def_type VARCHAR( 50 ) ,
bomb_def_nbr INT( 2 ) ,
bomb_def_ai INT( 1 ) ,
);

MySQL said: Documentation
#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 ')' at line 20

Also there was a big red X by the line
tgt_name VARCHAR( 50 ) ,


This file shows only 8kb in size. I am using phpmyadmin 2.11.9.5

Any ideas?
 
View user's profile Send private message
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Sat Dec 26, 2009 12:44 pm Reply with quote

Remove the "," on the last line.
Code:


bomb_def_ai INT( 1 ) ,

Code:


bomb_def_ai INT( 1 )

_________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. 
View user's profile Send private message
express







PostPosted: Sat Dec 26, 2009 2:02 pm Reply with quote

Nope that doesn't seem to work. I get another error message. I am stumped.
 
Palbin







PostPosted: Sat Dec 26, 2009 2:51 pm Reply with quote

What is the error because this should work.
Code:


CREATE TABLE badc_host_slots(
slot VARCHAR( 30 ) ,
STATUS INT( 1 ) ,
task INT( 1 ) ,
hlname VARCHAR( 30 ) ,
army INT( 1 ) ,
epoca INT( 10 ) ,
date DATE,
time TIME,
max_human INT( 2 ) ,
tgt_name VARCHAR( 50 ) ,
fig_attk_nbr INT( 2 ) ,
fig_def_nbr INT( 2 ) ,
bomb_attk_type VARCHAR( 50 ) ,
bomb_attk_nbr INT( 2 ) ,
bomb_attk_ai INT( 1 ) ,
bomb_def_type VARCHAR( 50 ) ,
bomb_def_nbr INT( 2 ) ,
bomb_def_ai INT( 1 )
);
 
express







PostPosted: Sat Dec 26, 2009 3:09 pm Reply with quote

Well I copied your's, saved it, and was able to import it just fine. I double checked my previous import and removed the , like you first said. Why that didn't work is beyond me. I thank you for the follow up and getting it solved.
The tables loaded perfectly, thank you.

Express

Happy Holidays! RavensScripts
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> MySQL

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©