Bug #49107 [Opn->Wfx]: Empty string is returned as NULL
| From: | kalle@php.net | Date: | Sat, 15 Oct 2016 23:13:43 +0000 |
| Subject: | Bug #49107 [Opn->Wfx]: Empty string is returned as NULL | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-204805@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=49107&edit=1
ID: 49107
Updated by: kalle@php.net
Reported by: jochem dot blok at fasterforward dot nl
Summary: Empty string is returned as NULL
-Status: Open
+Status: Wont fix
Type: Bug
Package: MSSQL related
Operating System: Debian
PHP Version: 5.2.10
Block user comment: N
Private report: N
New Comment:
With MSSQL being removed from PHP as of PHP7.0, and ext/mssql not having a maintainer, I'm
gonna close this report as a Won't fix, until maybe one day it will find a new maintainer.
Alternatively you can use sqlsrv from Microsoft if you are on Windows, or pdo_dblib if you are on
Unix.
Previous Comments:
------------------------------------------------------------------------
[2009-07-30 07:56:50] jochem dot blok at fasterforward dot nl
Additional info:
FreeTDS (tds version 8.0), Sql Server 2005 SP3
------------------------------------------------------------------------
[2009-07-30 07:53:37] jochem dot blok at fasterforward dot nl
Description:
------------
This is the same bug as reported in bug: 39213. An empty string is returned as NULL.
Reproduce code:
---------------
$conn = mssql_connect('host','user','password', true);
mssql_query("CREATE TABLE #tmp(c VARCHAR(10) NULL)", $conn) or
die("error querying");
mssql_query("INSERT INTO #tmp VALUES('')", $conn) or die("error
querying");
$res = mssql_query("SELECT * FROM #tmp", $conn) or die("query");
$row = mssql_fetch_assoc($res);
$s = is_null($row['c']) ? 'NULL' : $row['c'];
echo "got -$s-\n";
Expected result:
----------------
var_dump($s) should print string(0) ""
Actual result:
--------------
var_dump($s) print NULL
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=49107&edit=1