I came across what looks like an odd problem with a driver Zend_Dbor PHP PDO MySQL, which may stem from my ignorance of these two.
Suppose I have a MySQL table with NULLcapable TIME. If I run such a query in a MySQL client:
UPDATE mytable SET mytime = NULL WHERE id = 1;
Everything works as expected, and the mytime field will hold NULLas the value after this request.
However, if I run the same request in PHP through Zend_Db_Adapter, the mytime field will be set to '0:0:0'after such a request:
$db->getConnection()->exec('UPDATE mytable SET mytime = NULL WHERE id = 1');
How to set the TIME field to NULL?
I am using PHP5.3 with the PDO driver MySQL, Zend Framework 1.11 and MySQL 5.1.
source
share