Author |
Message |
express
Client

Joined: Jan 03, 2007
Posts: 94
|
Posted:
Sat Dec 26, 2009 11:51 am |
|
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? |
|
|
|
 |
Palbin
Site Admin

Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania
|
Posted:
Sat Dec 26, 2009 12:44 pm |
|
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. |
|
|
 |
express

|
Posted:
Sat Dec 26, 2009 2:02 pm |
|
Nope that doesn't seem to work. I get another error message. I am stumped. |
|
|
|
 |
Palbin

|
Posted:
Sat Dec 26, 2009 2:51 pm |
|
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

|
Posted:
Sat Dec 26, 2009 3:09 pm |
|
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!  |
|
|
|
 |
|