for me.
--
View this message in
context:http://n2.nabble.com/Converting-SQL-query-to-Cake-query-tp2434189p243...
Sent from the CakePHP mailing list archive at Nabble.com.
--
View this message in
context:http://n2.nabble.com/Converting-SQL-query-to-Cake-query-tp2434189p243...
Sent from
' = array('Post.view_count DESC'),
'limit' = 10
)
);
this worked for me.
--
View this message in
context:http://n2.nabble.com/Converting-SQL-query-to-Cake-query-tp2434189p243...
Sent from the CakePHP mailing list archive at Nabble.com.
--
View this message in
context:http
Remove that condition, you should be using associations instead. Once
you have an association, all related data will be returned, simply
contain it or up the recursion.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
you have an association, all related data will be returned, simply
contain it or up the recursion.
--
View this message in context:
http://n2.nabble.com/Converting-SQL-query-to-Cake-query-tp2434189p2435579.html
Sent from the CakePHP mailing list archive at Nabble.com
$topTen = $this-Post-find('list',
array(
'fields' = array('Post.id', 'Post.view_count'),
'order' = array('Post.view_count DESC'),
'limit' = 10
)
);
this worked for me.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
.
--
View this message in context:
http://n2.nabble.com/Converting-SQL-query-to-Cake-query-tp2434189p2436388.html
Sent from the CakePHP mailing list archive at Nabble.com.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
',
array(
'fields' = array('Post.id', 'Post.view_count'),
'order' = array('Post.view_count DESC'),
'limit' = 10
)
);
this worked for me.
--
View this message in
context:http://n2.nabble.com/Converting-SQL-query-to-Cake-query-tp2434189p243...
Sent from the CakePHP mailing list archive
)
);
this worked for me.
--
View this message in
context:http://n2.nabble.com/Converting-SQL-query-to-Cake-query-tp2434189p243...
Sent from the CakePHP mailing list archive at Nabble.com.
--
View this message in context:
http://n2.nabble.com/Converting-SQL-query-to-Cake-query
',
array(
'fields' = array('Post.id', 'Post.view_count'),
'order' = array('Post.view_count DESC'),
'limit' = 10
)
);
this worked for me.
--
View this message in
context:http://n2.nabble.com/Converting-SQL-query-to-Cake-query-tp2434189p243...
Sent from the CakePHP mailing list
.nabble.com/Converting-SQL-query-to-Cake-query-tp2434189p243...
Sent from the CakePHP mailing list archive at Nabble.com.
--
View this message in context:
http://n2.nabble.com/Converting-SQL-query-to-Cake-query-tp2434189p2437599.html
Sent from the CakePHP mailing list archive
)
);
this worked for me.
--
View this message in
context:http://n2.nabble.com/Converting-SQL-query-to-Cake-query-tp2434189p243...
Sent from the CakePHP mailing list archive at Nabble.com.
--
View this message in context:
http://n2.nabble.com/Converting-SQL-query-to-Cake
Hello, I am having trouble converting this SQL query to a Cake query that
uses find():
SELECT Page.*, COUNT(*) AS views FROM
pages AS Page
INNER JOIN page_views AS PageView ON Page.id = PageView.page_id
GROUP BY Page.id
ORDER BY COUNT(*) DESC
LIMIT 10 OFFSET 0
This is what I've got
12 matches
Mail list logo