Bug #68684 [Opn->Fbk]: driver returns false for NULL DATETIME column
| From: | dharman@php.net | Date: | Thu, 08 Apr 2021 21:11:34 +0000 |
| Subject: | Bug #68684 [Opn->Fbk]: driver returns false for NULL DATETIME column | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-233332@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=68684&edit=1
ID: 68684
Updated by: dharman@php.net
Reported by: lm at zork dot pl
Summary: driver returns false for NULL DATETIME column
-Status: Open
+Status: Feedback
Type: Bug
Package: PDO MySQL
Operating System: All
PHP Version: 5.6.4
Block user comment: N
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2014-12-29 12:41:53] 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);
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=68684&edit=1