MySQL Error Creating Record: Field doesn't have a default value

3 posts by 2 authors in: Forums > CMS Builder
Last Post: March 4, 2011   (RSS)

Re: [rentittoday] MySQL Error Creating Record: Field doesn't have a default value

By Jason - March 3, 2011

Hi,

There are a couple of ways to get around this. If you want to give this field a default value when creating a record, you can do this directly in your mysql insert query. A checkbox, for example, will have a value of either 1 or 0. so if you want to set it to be unchecked, you'd use this:

rit_seal = '0',

If you don't want to put a value into it through the insert query, you can turn off strict mode before you execute you're query.

Put this code above where you create your INSERT query:
mysqlStrictMode( false );

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] MySQL Error Creating Record: Field doesn't have a default value

By rentittoday - March 4, 2011

It is all coming back to me now!
We have had to do this in the past and I totally overlooked it this time. :/

Thanks again!
Jason Glass