roslen Posted August 9, 2007 Share Posted August 9, 2007 Help plz. i get this error when running code below. Error SQL query: CREATE TABLE wateva_table( id int( 9 ) DEFAULT '0' NOT NULL AUTO_INCREMENT , name varchar( 20 ) NOT NULL , COMMENT text NOT NULL , date varchar( 10 ) NOT NULL , time varchar( 10 ) NOT NULL , ip varchar( 39 ) , PRIMARY KEY ( id ) ) MySQL said: #1067 - Invalid default value for 'id' can i just remove the default like this: id int( 9 ) NOT NULL AUTO_INCREMENT , will that make the default to number '0' Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted August 9, 2007 Share Posted August 9, 2007 If its auto_increment you don't need to set a default value. The default value comes from auto_increment. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.