Jump to content


Photo

whats wrong with this?


  • Please log in to reply
No replies to this topic

#1 me1000

me1000
  • Members
  • PipPipPip
  • Advanced Member
  • 183 posts

Posted 20 November 2005 - 12:24 AM

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 [/quote]

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users