Currently I am using
$posts = $this->Post->find('all');
and it returns complete entries of the table posts but how can I get only partial entries. Some thing like
SELECT body,title FROM posts
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Pass the “fields” option and specify (in an array) what fields you want to retrieve.
I hate to be the guy that writes this, cause it usually bothers me, but I think this question is worth of “RTM”.
This page in the book explains it all: http://book.cakephp.org/2.0/en/models/retrieving-your-data.html