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] Quote Link to comment 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? Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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. 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.