Nate,
Thanks a lot for the quick response.  I really appreciate it
I tried to use beforeSave and it ended up getting rid of my sql error,
but it would not save any data.  So I added

if (empty($this->data['Story']['dateSend'])){
   unset($this->data['Story']['dateSend']);
}

to the controller and it seems to work great.  Is there any
disadvantage to doing it this way?  I'm pretty new to OOP and
especially the MVC way of doing things and if this is not the best way
to do it, I'd like to understand how.
Thanks again



On Jan 25, 10:59 pm, "nate" <[EMAIL PROTECTED]> wrote:
> Just add a beforeSave callback in your model that unsets the field from
> $this->data if it is empty.
>
> On Jan 25, 5:49 pm, "miggs" <[EMAIL PROTECTED]> wrote:
>
>
>
> > I'm sure the answer is right in front of me as it normally is, but I'm
> > just not seeing.  I used the bake.php script to create the basic
> > scaffolding for my project. I then  added a datepicker (from
> > frequency-decoder.com) to the date fields.  It is working great, I
> > think it's a fantastic script.  If I create a 'new' record, and I leave
> > the date fields blank, it works just fine, but if I go in and 'edit'
> > that same page, and leave the date fields blank, it gives me an error.
> > If I add a date to the fields in either 'new' or 'edit', it works just
> > fine.
>
> > The SQL error I get when I turn on debug in the edit view is:
>
> > 1292: Incorrect date value: '' for column 'dateSend' at row 1
>
> > I don't want to make this a required field and it is set to allow nulls
> > in mysql.  Is there something I need to do so that if it's empty it
> > doesn't use     `dateSend`=''     in the SQL statement.
>
> > Any help is most appreciated- Hide quoted text -- Show quoted text -


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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