Hi,

i'm trying to save a single datefield. My Controller looks like this:

-------------------------%<--------------------------------
// Set ID and lifetime
$this->MusicianRequest->id = $id;

$lifetime = trim(date( "Y-m-d H:i:s", strtotime( "+4 weeks",
strtotime($this->data['MusicianRequest']['lifetime']) ) ) );

echo $lifetime;  // FirstCase
$this->MusicianRequest->saveField('lifetime',$lifetime);  //
SecondCase
-------------------------%<--------------------------------

What happens?
It shows me the right lifetime output in the FirstCase (e.g.
2007-10-21 23:02:00), but the query looks like this:
UPDATE `musician_requests` SET `lifetime` = '2007-09-23 23:02:00'
WHERE `id` IN (6)

Perhaps i create $lifetime the wrong way? But if I use a manual
created SQL query
-------------------------%<--------------------------------
$this->MusicianRequest->query( "UPDATE `musician_requests` SET
`lifetime` = '".$lifetime."' WHERE `id` IN (".$id.")" );
-------------------------%<--------------------------------
 it works....

I think it's an cake related problem, cause the php echo output
displays the correct datetime.
The query cakephp creates, is definitly not the desired lifetime...


Any ideas or hints?

Regards,
Alexander


--~--~---------~--~----~------------~-------~--~----~
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