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 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
No comments:
Post a Comment