I get this code when i try and run the register form on my website, which allows user to create a user name and password.Code:Could not insert data because Incorrect integer value: 'NULL' for column 'id' at row 1
this is the area of code i believe is failing:
And this is the current layout of the table:Code:$insert = mysql_query("insert into $table values ('NULL', '".$_POST['fname']."', '".$_POST['username']."', '".$encrypted_password."', '".$_POST['email']."' , '".$_POST['loc']."')") or die("Could not insert data because ".mysql_error());
This setup works fine on one database host, however it does not work on the one im trying to switch too. Am i missing something?Code:$create = "create table $table ( id smallint(5) NOT NULL auto_increment, realname varchar(30) NOT NULL, username varchar(30) NOT NULL, password varchar(32) NOT NULL, email varchar(30) NOT NULL, location varchar(30) NOT NULL, PRIMARY KEY (id), UNIQUE KEY username (username) );";
Thanks.



Reply With Quote

Bookmarks