Title: How can i write a MySQL query in CakePHP
Tags: mysql;cakephp;cakephp-1.3
Question: How can I write the following mysql query in cakephp:
SELECT * FROM table WHERE DATE BETWEEN '2008-12-23' AND '2008-12-25';
Comment: [What have you tried?](http://whathaveyoutried.com)

Here is the accepted answer: Using Cake's ORM, it would look something like this (where Model is the name of your model, usually a singularized version of your table name):
$this-&gt;Model-&gt;find('all', array('conditions' =&gt; array(
'Model.date BETWEEN ? AND ?' =&gt; array('2008-12-23', '2008-12-25')));
Check here for more details:
http://book.cakephp.org/2.0/en/models/retrieving-your-data.html


{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 1, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2012:00:08/16/12', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<mysql><cakephp><cakephp-1.3>', 'Title': 'How can i write a MySQL query in CakePHP', 'ViewCount': 1034, 'id': 11988299, 'user_AboutMe': '<p>i am b.tech. student. (Field- IT )</p>\n', 'user_AccountId': 1755130.0, 'user_DisplayName': 'jitender', 'user_Reputation': 33.0, 'user_Views': 12.0, 'user_id': 1603360.0}}