Mysql/Create table

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
mrrobotto
Forum Commoner
Posts: 40
Joined: Thu Sep 26, 2002 9:30 pm
Contact:

Mysql/Create table

Post by mrrobotto »

I am new to Mysql and I am using phpMyAdmin. I have been trying to build an e-commerce site that I downloaded from DevShed.com and everything has went fine until I got towards the end. I keep getting a syntax error at the end of the following block of code; Index username (username). I have tried everything and have not been able to get Mysql to except it.

Any help will be greatly appreciated the block of code is as follows:

CREATE TABLE orders (
id int not null auto_increment,
username varchar(16) not null,
o_timestamp datetime,
a_timestamp datetime,
status tinyint,
status_details varchar(255),
custinfo text,
comments text,
amount float(5,2),
PRIMARY KEY (id)
INDEX username (username)
)
:(
nieve
Forum Newbie
Posts: 11
Joined: Tue Dec 03, 2002 10:26 pm

Post by nieve »

CREATE TABLE orders (
id int not null auto_increment,
username varchar(16) not null,
o_timestamp datetime,
a_timestamp datetime,
status tinyint,
status_details varchar(255),
custinfo text,
comments text,
amount float(5,2),
PRIMARY KEY (id),
INDEX username (username)
)
mrrobotto
Forum Commoner
Posts: 40
Joined: Thu Sep 26, 2002 9:30 pm
Contact:

Post by mrrobotto »

That did the trick thanks for the help
Post Reply