Page 1 of 1
Field 'id' doesn't have a default value
Posted: Wed Jul 22, 2009 9:52 am
by macbeth
I am getting this error when i try to insert data into my mysql database.
Field 'id' doesn't have a default value
Does anybody know why I would be getting this?
Re: Field 'id' doesn't have a default value
Posted: Wed Jul 22, 2009 10:32 am
by DaiLaughing
Have you forgotten to include a value for id in your query? MySQL is missing that value and doesn't have a default one to put in. If it is the primary key you probably need to make it auto-increment.
Re: Field 'id' doesn't have a default value
Posted: Wed Jul 22, 2009 10:34 am
by macbeth
That was my first thought, but when I went into the database and checked, it is set to auto-increment.