> as far as I understood you, cakephp inserts NULL instead of '0' right?

Correct

> Set your database to default '0' as it should work.

It doesn't as MySQL refuses to accept NULL for a NOT NULL field and if
NULL is allowed then it supersedes the default 0 value.

> - If it does not add "function beforeSave() { /* ... */ }" to your
> YourModelWithLotsOfInts
> - Within that check if a variable is a.) "" or empty or NULL or
> whatever your want to test again
> - ...As well if it is your desired INT - check var $_schema for that.
> - You can do that in a loop against the data array.
> - If the constrains are right just change those values before saving.

This was what I expected the answer to be, but what are the
performance and coding differences between doing this in the app
(looping through a large multi-dimensional array) and adding the db
trigger which only acts upon the individual SQL calls which are passed
to it?

>From my limited research on db triggers, they do seem to offer better
performance and they are certainly working for me .. but I am happy to
be told otherwise by someone with more knowledge :)

Regards,

Paul.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to