When I create a record with a form and leave integer fields empty,
Cake tries to insert '' into that field instead of null, leading to
the error "SQL Error: 1366: Incorrect integer value: '' for column
'year' at row 1"."
Now this is easily fixed by putting this in my controller for every
field before saving:
if ($this->data['Text']['year'] == '') $this->data['Text']
['year'] = null;
But this is quite a hassle so I wonder if there's a way to get Cake to
use null instead of '' for integer fields?
Tia.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---