I have a doubt on how I should write my query on CakePHP. Instead of using the querybuilder from CakePHP I´d like to use the statement query. So I my query is:
SELECT `Post`.id, `Post`.title, COUNT(`Like`.id) AS `Posts_Liked`
FROM posts AS `Post`, likes AS `Like`
WHERE `Post`.id = `Like`.posts_id;
But when I send the result to the View page, I can´t get the count number when calling $post['post']['Posts_Liked'], so how should I call this data in the view?
debug($result); die;in the controller and see if it is what you expecting