try a pr($this->data) in your controller and you'll the date is not
"DB compliant" (it is split in several parts)
do a $this->cleanUpFields() before Model->save()

On 30 avr, 13:13, "annie.r.knight" <[EMAIL PROTECTED]>
wrote:
> I'm very new to CakePHP so please do bear with me.
>
> I've used the simple blog application from the manual as a crib for a
> small application that I'm creating. I ran into a problem when simply
> trying to deal with some date inputs in forms. The dates would insert
> ok, but if I tried to edit them I'd run into a brick wall: there was
> no update query being executed at all. If I changed the field type to
> text it was working ok.
>
> My controller's add() function looked like this:
>
>         function add() {
>
>                 if (!empty($this->data)) {
>                         if ($this->Closeddate->save($this->data)) {
>                                 $this->flash('The new details have been 
> saved.','/closeddates');
>                         }
>                 }
>
>         }
>
> And the edit() function:
>
>         function edit($id = null) {
>
>                 $this->Closeddate->id = $id;
>
>                 if (empty($this->data)) {
>                         $this->data = $this->Closeddate->read();
>                 }
>                 else {
>
>                         if 
> ($this->Closeddate->save($this->data['Closeddate'])) {
>                                         $this->flash('Your Closed Date has 
> been updated.','/
> closeddates');
>                         }
>                 }
>         }
>
> I fixed it by changing the parameter to the save() function to $this-
>
> >data (less the array index).
>
> So my question: Why does the broken method not work with dates? What
> did I do wrong? What am I misunderstanding?
>
> Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to