|  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: 2021-04-09 11:12 UTC
From: lm at zork dot pl Assigned: dharman (profile)
Status: Closed Package: PDO MySQL
PHP Version: 5.6.4 OS: All
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: lm at zork dot pl
New email:
PHP Version: OS:


 [2014-12-29 12:41 UTC] lm at zork dot pl
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);

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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-04-08 21:11 UTC]
-Status: Open +Status: Feedback
 [2021-04-08 21:11 UTC]
Unfortunately, I can't reproduce it with any of the currently available PHP versions. If you are still encountering this issue with PHP 8 or even PHP 7.4 could you provide more details, please? If possible please create a test case that we can copy and paste.
 [2021-04-08 21:29 UTC] lm at zork dot pl
-Status: Feedback +Status: Open
 [2021-04-08 21:29 UTC] lm at zork dot pl
No chance, sorry. My last php project was about six years ago :-) 

I think you can safely close this case.
 [2021-04-09 11:12 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: dharman
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Nov 30 13:03:49 2021 UTC