I got app that need to be recoded in CakePHP.
I got following select with subselects:
SELECT COUNT(*) AS item1,
(SELECT COUNT(*) FROM portal_members) AS item3,
(SELECT COUNT(*) FROM portal_reviews) AS item3,
(SELECT COUNT(*) FROM portal_downloads) AS item4
FROM portal_articles
WHERE 1 = 1
Anyone have any idea how to create that query using CakePHP find($type, $params) ?
If that is your exact query, I’d recommend doing it in four passes.
It might take a wee bit longer to run, but your intentions are much clearer and the code would be much cleaner.