Hi,
I'm trying to write a PHP script to create a MySQL table. When I try to run the script, it won't create the table. I noticed that it will create it if I don't put "auto_increment" or "Primary key" in the script. If I take those two things it works great, but when I try to put that in, it fails. Can someone please shed some light on why I can't get this to work?
I'm trying to write a PHP script to create a MySQL table. When I try to run the script, it won't create the table. I noticed that it will create it if I don't put "auto_increment" or "Primary key" in the script. If I take those two things it works great, but when I try to put that in, it fails. Can someone please shed some light on why I can't get this to work?
Code:
<?php
$createlog="CREATE TABLE login (cusid int(11) NOT NULL DEFAULT '123000' auto_increment, cid VARCHAR(25), cpswd VARCHAR(15), fname VARCHAR(25), lname VARCHAR(25), email VARCHAR(50), primary key('cusid'))";
?>