When you submit a form, your data will contain empty values and when cake tries to insert these empty values into your columns which allow NULL, it will be 0 or 0000-00-00 for dates.
See: http://bakery.cakephp.org/articles/view/null-behavior#958 Slight updated to use $this->loadInfo() instead: http://bin.cakephp.org/view/580118960 On 5/23/07, ricarou51 <[EMAIL PROTECTED]> wrote: > > > So cake considers 0 as default value for an integer isn't it ? > > On 23 mai, 15:44, "Davide" <[EMAIL PROTECTED]> wrote: > > Chris Hartjes wrote: > > > Perhaps I'm wrong, but last I checked you can't set an integer to > > > NULL...the default for an integer would be zero, wouldn't it? > > > > on MySQL 4.1.14-nt (Windows XP) > > > > CREATE TABLE `xyz` ( > > `field1` int(11) default NULL, > > `field2` int(11) default NULL > > ) ENGINE=MyISAM DEFAULT CHARSET=latin1 > > > > mysql> insert into xyz (field2) value (1); > > Query OK, 1 row affected (0.00 sec) > > > > mysql> select * from xyz; > > +--------+--------+ > > | field1 | field2 | > > +--------+--------+ > > | NULL | 1 | > > +--------+--------+ > > 1 row in set (0.00 sec) > > > > I had the doubt too :) > > > > Bye > > Davide > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---