scott532 Posted August 31, 2006 Share Posted August 31, 2006 the command line says:[b]ERROR 1067 (42000): Invalid default value for 'usernumber'[/b]and i don't get whats wrong with the default '0'[b]usernumber MEDIUMINT(10) DEFAULT '0' NOT NULL AUTO_INCREMENT,[/b] Link to comment https://forums.phpfreaks.com/topic/19227-error-with-default-value/ Share on other sites More sharing options...
Corona4456 Posted August 31, 2006 Share Posted August 31, 2006 Why are you defaulting an auto increment field to 0? Link to comment https://forums.phpfreaks.com/topic/19227-error-with-default-value/#findComment-83269 Share on other sites More sharing options...
scott532 Posted August 31, 2006 Author Share Posted August 31, 2006 I don't know... I'm just reading a book that I guess was wrong. I got rid of the default value and set up the tables. Shouldnt it be starting at zero anyhow? Link to comment https://forums.phpfreaks.com/topic/19227-error-with-default-value/#findComment-83276 Share on other sites More sharing options...
JayBachatero Posted August 31, 2006 Share Posted August 31, 2006 Auto increment fields CAN'T have a default falue since they increase on each row added unless specified in the INSERT query. Link to comment https://forums.phpfreaks.com/topic/19227-error-with-default-value/#findComment-83282 Share on other sites More sharing options...
Corona4456 Posted August 31, 2006 Share Posted August 31, 2006 [quote author=JayBachatero link=topic=106340.msg425162#msg425162 date=1157003392]Auto increment fields CAN'T have a default falue since they increase on each row added unless specified in the INSERT query.[/quote]What he said... by default auto inc starts at 1 not 0. Link to comment https://forums.phpfreaks.com/topic/19227-error-with-default-value/#findComment-83555 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.