Sebastian Göttschkes wrote:
> Hi,
>
> i got the following problem using cakePHP 1.2 RC3:
>
> My Model 'Employee' has a attribute called 'birthday' (datatype:
> DATE). In the add-view, I have the following code:
> <?= $form->input('birthday',array('type'=>'text'));?>
> If i left this field blank when adding an employee, this employee has
> the birthday '0000-00-00' saved in the database. I would rather like
> the birthday having the null-value, because 0000-00-00 is no valid
> birthday.
>
>
Set the date field to NULL
|ALTER TABLE `employees` CHANGE `birthday` `birthday` DATE NULL;
IIRC
HTH
|
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---