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'




Solution 1: Remove ONLY_FULL_GROUP_BY from mysql console

mysql > SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));

Solution 2: Remove ONLY_FULL_GROUP_BY from phpmyadmin

– Open phpmyadmin & select localhost

– Click on menu Variables & scroll down for sql mode

– Click on edit button to change the values & remove ONLY_FULL_GROUP_BY & click on save





To keep your current mysql settings and


I suggest to visit your phpmyadmin or whatever client you are using and type:

SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY','')  copy_me


next copy result to your my.ini file.

For mint:

sudo nano /etc/mysql/my.cnf

For ubuntu 16 and up:

sudo nano /etc/mysql/my.cnf

For ubuntu 14-16:





Database engine difference of InnoDB, MyISAM, Memory

Database engine difference of InnoDB, MyISAM, Memory


This is the default storage engine for MySQL 5.5 and higher.  It provides transaction-safe (ACID compliant) tables, supports FOREIGN KEY referential-integrity constraints.  It supports commit, rollback, and crash-recovery capabilities to protect data.  It also support row-level locking. It’s “consistent nonlocking reads” increases performance when used in a multiuser environment.  It stores data in clustered indexes which reduces I/O for queries based on primary keys.


This storage engine, manages non transactional tables, provides high-speed storage and retrieval, supports full text searching.


Provides in-memory tables, formerly known as HEAP.  It sores all data in RAM for faster access than storing data on disks.  Useful for quick looks up of reference and other identical data.



For Database engines Please visit the link below,

Database engine in php