Jump to content


Photo

Error with Default Value


  • Please log in to reply
4 replies to this topic

#1 scott532

scott532
  • Members
  • PipPip
  • Member
  • 14 posts
  • LocationSanta Barbara, CA. (USA)

Posted 31 August 2006 - 04:07 AM

the command line says:
ERROR 1067 (42000): Invalid default value for 'usernumber'
and i don't get whats wrong with the default '0'
usernumber MEDIUMINT(10) DEFAULT '0' NOT NULL AUTO_INCREMENT,

#2 Corona4456

Corona4456
  • Members
  • PipPipPip
  • Advanced Member
  • 244 posts
  • LocationEl Paso, TX

Posted 31 August 2006 - 04:14 AM

Why are you defaulting an auto increment field to 0?
What is the CoronaMatrix?

#3 scott532

scott532
  • Members
  • PipPip
  • Member
  • 14 posts
  • LocationSanta Barbara, CA. (USA)

Posted 31 August 2006 - 04:36 AM

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?

#4 JayBachatero

JayBachatero
  • Members
  • PipPipPip
  • Advanced Member
  • 296 posts
  • LocationQueens NY

Posted 31 August 2006 - 05:49 AM

Auto increment fields CAN'T have a default falue since they increase on each row added unless specified in the INSERT query.
JayBachatero
SMF Developer && Converter Specialist

#5 Corona4456

Corona4456
  • Members
  • PipPipPip
  • Advanced Member
  • 244 posts
  • LocationEl Paso, TX

Posted 31 August 2006 - 04:04 PM

Auto increment fields CAN'T have a default falue since they increase on each row added unless specified in the INSERT query.

What he said... by default auto inc starts at 1 not 0.
What is the CoronaMatrix?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users