php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68684 driver returns false for NULL DATETIME column
Submitted: 2014-12-29 12:41 UTC Modified: -
From: lm at zork dot pl Assigned:
Status: Open Package: PDO MySQL
PHP Version: 5.6.4 OS: All
Private report: No CVE-ID:
Have you experienced this issue?
Rate the importance of this bug to you:

 [2014-12-29 12:41 UTC] lm at zork dot pl
Description:
------------
PDO mysql driver configured as in example returns false for DATETIME column. VARCHARS, INT and other columns are returned properly (as php null value).

Test script:
---------------
   	$db = new PDO($dsn, $db_user, $db_pass);
    	$db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);
    	$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

    	//without this PDO returns all data as strings
    	$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);


Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sat Aug 19 22:01:35 2017 UTC