Tyler
January 26th, 2006, 04:05
I'm not too familiar with CREATE TABLE as I've always just done it through PMA, but not many are familiar with it and an install script is much easier.
What's weird is that it works on some PHP 4.4.x, and works perfectly on 5, so I have no idea what I am doing wrong. Here is what I'm doing:
$create_query = mysql_query("CREATE TABLE user(`id` INT( 10 ) NOT NULL AUTO_INCREMENT PRIMARY KEY,
`username` VARCHAR(255) NOT NULL,
`fname` VARCHAR(255) NOT NULL,
`lname` VARCHAR(255) NOT NULL,
`email` VARCHAR(255) NOT NULL,
`password` VARCHAR(255) NOT NULL)");
Just one of the many variations I have tried. That ^^ returns an error of:
Error! Could not create table: 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 'user(`id` INT( 10 ) NOT NULL AUTO_INCREMENT PRIMARY KEY, `user
Any help is highly appreciated as I've been working at this for days with no luck. Thanks!
What's weird is that it works on some PHP 4.4.x, and works perfectly on 5, so I have no idea what I am doing wrong. Here is what I'm doing:
$create_query = mysql_query("CREATE TABLE user(`id` INT( 10 ) NOT NULL AUTO_INCREMENT PRIMARY KEY,
`username` VARCHAR(255) NOT NULL,
`fname` VARCHAR(255) NOT NULL,
`lname` VARCHAR(255) NOT NULL,
`email` VARCHAR(255) NOT NULL,
`password` VARCHAR(255) NOT NULL)");
Just one of the many variations I have tried. That ^^ returns an error of:
Error! Could not create table: 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 'user(`id` INT( 10 ) NOT NULL AUTO_INCREMENT PRIMARY KEY, `user
Any help is highly appreciated as I've been working at this for days with no luck. Thanks!