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' Link to comment https://forums.phpfreaks.com/topic/64056-1067-invalid-default-value-for-id/ 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. Link to comment https://forums.phpfreaks.com/topic/64056-1067-invalid-default-value-for-id/#findComment-319272 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.