Forum Moderators: mack

Message Too Old, No Replies

MySQL question

         

Soul

9:49 am on Oct 12, 2004 (gmt 0)

10+ Year Member



Hi im new here and was wondering if someone could help me with a mysql question.

When i load tables into mysql i get this error message

"#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 'CREATE TABLE easy_article (
id_article int auto_increment NO "

I have a feeling that the tables are for an older version of mysql, currently my server is using version 4.0.21.

The tables i am trying to load are:

CREATE TABLE easy_rubrique (
id int auto_increment NOT NULL PRIMARY KEY,
Classement int(10),
titre varchar(70)
)

CREATE TABLE easy_article (
id_article int auto_increment NOT NULL PRIMARY KEY,
numero_article int,
titre_article varchar(100),
article text,
image varchar(100),
rubrique int(10)
)

CREATE TABLE easy_contact (
id int auto_increment NOT NULL PRIMARY KEY,
tel varchar(100),
email varchar(100),
nom varchar(30),
prenom varchar(30),
rue varchar(100),
cp varchar(10),
ville varchar(50)
)

insert into easy_contact values ('1', '','', '', '', '', '', '')

If these tables are for an older version of mysql, then would someone be able to tell me how to fix them so they run on a newer version?

thanx in advance :-)

Soul

Birdman

11:50 am on Oct 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to Webmaster World!

Try adding your primary key at the end.

CREATE TABLE easy_rubrique (
id int NOT NULL auto_increment,
Classement int(10),
titre varchar(70),
PRIMARY KEY(id)
)

Don't forget to add indexes on the common(lookups) fields.

Regards,
Birdman

Soul

10:24 pm on Oct 12, 2004 (gmt 0)

10+ Year Member




Welcome to Webmaster World!
Try adding your primary key at the end.

CREATE TABLE easy_rubrique (
id int NOT NULL auto_increment,
Classement int(10),
titre varchar(70),
PRIMARY KEY(id)
)

Don't forget to add indexes on the common(lookups) fields.

Thanx for the welcome Birdman, and thanx for replying :-)

I see how you moved the PRIMARY KEY(ID), but what do i put in the "(ID)" part?

Plus im not sure what you mean by "indexes on the common (lookups) fields"

Sorry... im fairly new to web design and im just trying to get a php script i downloaded to work.

Soul

killroy

10:59 pm on Oct 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



you leave the (Id) part as it is. It indicates that you desire to place a primary key index on the "id" column that you created in the first line.

SN