Wednesday, March 10, 2010

Re: updateAll problem in 1.3RC1

Yes, it is documented in 1.2.

"The $fields array accepts SQL expressions. Literal values should be
quoted manually."
from http://book.cakephp.org/view/75/Saving-Your-Data

On 10 mar, 10:34, Ernesto <e.fanz...@gmail.com> wrote:
> Hello
>
> $this->Order->updateAll(array("date_purchase" => date("Y-m-d H:i:s")),
> array("id" => $order_id));
>
> throws this error
>
> Warning (512): SQL Error: 1064: You have an error in your SQL syntax;
> check the manual that corresponds to your MySQL server version for the
> right syntax to use near '16:31:34  WHERE `id` = 214'
>
> Query: UPDATE `commesse` AS `Commessa` SET `Commessa`.`data_scarico` =
> 2010-03-10 16:31:34 WHERE `id` = 214
>
> cake isn't adding quotes to SQL.
>
> is that intended?

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate