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: 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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: lm at zork dot pl
New email:
PHP Version: OS:

 

 [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

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-04-08 21:11 UTC] dharman@php.net
-Status: Open +Status: Feedback
 [2021-04-08 21:11 UTC] dharman@php.net
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] dharman@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: dharman
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 17:01:31 2024 UTC