We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

How to execute mysql datediff in phql

Hi,

Can anyone please suggest me how to execute the below query with phalcon sql ?

mysql> SELECT DATEDIFF('2015-03-11','2015-01-12') AS days;

This way:

$data = $this->db->fetchOne("SELECT DATEDIFF('2015-03-11', '2015-01-12') AS days");


13.2k

Hi,

Thanks, I will update it.

Raja K