CodeIgniter Forums

Full Version: database error default values
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Unknown[/eluser]
Hi

Found a bug (I think)

I'm using igniter 1.6.3, codex2 rc14.2, PHP5 and MySQL5.
After install, when I try to access the page to login it gives me this error

A Database Error Occurred
Error Number: 1364
Field 'session_data' doesn't have a default value
INSERT INTO ci_sessions (session_id, session_start, session_last_activity, session_ip_address, session_user_agent) VALUES ('1b02c4a60be799d5f85d0682298dad23', 1222853353, 1222853353, '127.0.0.1', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-PT; rv')

To over pass this, i change the default value of the field "session_data" to NULL. Then I can make the login and access the backend. But when I try to insert a value in Related Example I get other error

A Database Error Occurred
Error Number: 1364
Field 'example_id' doesn't have a default value
INSERT INTO `related_example` (`name`, `description`) VALUES ('dsgfg', 'dfgfdhg')

El Forum

[eluser]moldova[/eluser]
The issue described here is related to MySQL5 strict mode which can be turned off in my.ini file. Not sure if it is the best workaround to the problem. Has anybody solved this issue the other way?