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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2021 The PHP Group
All rights reserved.
Last updated: Wed Oct 27 16:03:39 2021 UTC