I need help Please....

From: Date: Wed, 12 Sep 2001 22:16:14 +0000
Subject: I need help Please....
Groups: php.db 
Request: Send a blank email to php-db+get-12386@lists.php.net to get a copy of this message
Hello all, I tried to create a table which included primary key and a unique key. But I got this error. You have an error in your SQL syntax near 'UNIQUE,hpassword VARCHAR(50),head VARCHAR(50),body VARCHAR(50),ears VARCHAR(50),' at line 1 Can anyone help me please. This is my code. -- Below <? $link=mysql_pconnect("hostname","Name","Password") or die(mysql_error()); mysql_select_db("DBname") or die(mysql_error()); $query="create table Body (id int unsigned auto_increment NOT NULL PRIMARY KEY,"; $query.="husername VARCHAR(50) not null UNIQUE,"; $query.="hpassword VARCHAR(50),"; $query.="head VARCHAR(50),"; $query.="body VARCHAR(50),"; $query.="ears VARCHAR(50),"; $query.="eyes VARCHAR(50),"; $query.="hair VARCHAR(50),"; $query.="mouth VARCHAR(50),"; $query.="nose VARCHAR(50),"; $query.="date date not null,"; $query.="time time not null)"; mysql_query($query) or die(mysql_error()); ?> Thanks. Kelvin.

« previous php.db (#12386) next »