CakePhp – find condition for a query between two dates

How to  find condition for a query between two dates in Cakephp?

 

# Example-1:

$conditions = array(
    'conditions' => array(
       'and' => array(
            array('Item.date_start <= ' => $date,
                  'Item.date_end >= ' => $date
            ),
       'Item.title LIKE' => "%$title%",
       'Item.status_id =' => '1'
    )
  ) 
);

Leave a Reply

Your email address will not be published. Required fields are marked *