Jump to content

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

Link to comment
https://forums.phpfreaks.com/topic/2900-whats-wrong-with-this/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.