Piorun Posted April 2, 2011 Posted April 2, 2011 I've got problem with this line: mysql_query(handler, "CREATE TABLE tc_example(id INT NOT NULL AUTO_INCREMENT)" ) What i'm doing wrong??? P.S. handler return true, but table is not creating... -.-
Moderators Citizen Posted April 4, 2011 Moderators Posted April 4, 2011 If you want to set 'AUTO_INCREMENT' on a column, you have to set this column as a primary key: mysql_query(handler, "CREATE TABLE tc_exemple (id INT NOT NULL AUTO_INCREMENT ,PRIMARY KEY ( id ))" ) If it don't work, maybe the handler is wrong or you don't have the sufficient rights to create the table.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now