I want to execute a simple query:
SELECT DATEDIFF(now(), '2015-02-05');
How to execute this query in Zend Framework 1.x?
$sql = "SELECT DATEDIFF(now(), '2015-02-05')";
$db->fetchRow($sql);
or
$sql = "SELECT DATEDIFF(now(), '2015-02-05')";
$db->fetchRow($sql);
I checked the Zend manual, there are some other functions like fetchCol()
, but in my project, there is no such a method, just have fetchAll()
, fetchRow()
.
I am actually using a Zend Framework extension which is built upon Zend Framework, and it is in the 'lib' folder of the project. I guess this is why I can only use fetchAll()
, fetchRow()
.
Anyone know how to execute such a simple query in Zend Framework?