Jump to content

Archived

This topic is now archived and is closed to further replies.

me1000

whats wrong with this?

Recommended Posts

hello I have been reading the php book, php and mysql web development. im getting into the sql part of it now, im using the wamp server hosted on my computer its just for testing purposes so i do not have to upload all my files.

 

anyway heres my sql file

create table customers
( customerid int unsigned not null auto_increment primary key,
  name char(30) not null,
  address char(40) not null,
  city char(20) not null,
);

 

I have run it through phpMyAdmin and Im getting this error

 

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]#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 6

 

the sql query is

 

 CREATE TABLE customers(
customerid int unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY ,
name char( 30 ) NOT NULL ,
address char( 40 ) NOT NULL ,
city char( 20 ) NOT NULL ,
) 

 

 

i really have no idea whats wrong with it, im using mysql 5 and i have copied it exactly as the bok has it.

 

 

{Edit} I also tried the sql comandline not sure if im doing this right if not could you please correct me,

 

mysql> -h localhost -u bookorama books -p < c:/wamp/www/php/bookorama.sql;

ERROR 1064 (42000): 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 '-h lo
calhost -u bookorama books -p < c:/wamp/www/php/bookorama.sql' at line 1
mysql>

 

thank you,

Me1000

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.