How blind am I? I never spotted that with updateAll(), which is the
only time we use the $fields array in this manner, but then again
whenever I use updateAll() it's to change the value of some flags so
my value must have always been 1 or 0 and therefore worked without an
issue.
Learn something n
In the updateAll() section of the CakePHP Book (http://
book.cakephp.org/view/1031/Saving-Your-Data) has the following
information box:
The $fields array accepts SQL expressions. Literal values should be
quoted manually.
It's a bit terse, but basically it's saying that if you want to update
a fie
The problem is the value sky needs single quotes around it otherwise
MySQL tries to find a field with that name. The bigger problem is I
have no idea why Cake would take the value and not wrap it in single
quotes as it always has done for me no matter what version I have
used.
What do you get if
I use updateAll to change theme name
$this->Theme->updateAll(array('Theme.name' => $name),
array('Theme.user_id' => $id));
I got unknow column
this sql
UPDATE `themes` AS `Theme` SET `Theme`.`name` = sky WHERE
`Theme`.`user_id` = 128
thank
--
Our newest site for the community: CakePHP Video Tu