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.



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to