You could use a db trigger. Assuming you are using MySQL: <http://en.wikipedia.org/wiki/Database_trigger#Triggers_in_MySQL>
you should be able to extend the example to convert NULL to 0. //mathias 2009/5/9 WebbedIT <[email protected]>: > > The above is the result of a debug($this->data) after submission to > the controller. > > Obviously more fields would be completed in typical usage, but still > there would be a lot left blank. I tried adding a default option at > dbase level but Cake still passes NULL as a value which trips the NOT > NULL setting in the MySQL table. If you allow NULL then that's what > get's entered but as I am doing a lot of numerical calculations with > this data I really need them to default to 0. > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
