I'm porting my app from cakephp 1.2 to 1.3 and followed all steps in
the migration guide. Still having troubles with find queries.

I have quite some queries doing:

$this->User->id = 4;
$data = $this->User->find('first');

Cake 1.2 builds the following query:
SELECT `User`.`id`, ....  FROM `users` AS `User` WHERE `User`.`id` = 4
ORDER BY `name` ASC LIMIT 1

Cake 1.3.1 builds a different query:
SELECT `User`.`id`,.... FROM `users` AS `User` WHERE 1 = 1 ORDER BY
`name` ASC LIMIT 1

I just get the first record, but not the one that matches the set id.

I like the short and readable notation of this query.
Is this a wrong way of retreiving model data? Should I go for the long
notation  (including the conditions option that tells find to search
for User.id = 4) ?? Or is it a cake bug?

Bests,

Bram

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