Bug #42474 [Asn->Opn]: mssql_fetch_* returns 0 instead of NULL when a bit field is NULL

From: Date: Mon, 29 Dec 2014 01:04:52 +0000
Subject: Bug #42474 [Asn->Opn]: mssql_fetch_* returns 0 instead of NULL when a bit field is NULL
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-189283@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=42474&edit=1 ID: 42474 Updated by: kalle@php.net Reported by: jpittman2 at gmail dot com Summary: mssql_fetch_* returns 0 instead of NULL when a bit field is NULL -Status: Assigned +Status: Open Type: Bug Package: MSSQL related Operating System: Windows 2003 (5.2) PHP Version: 5.2.3 -Assigned To: fmk +Assigned To: Block user comment: N Private report: N Previous Comments: ------------------------------------------------------------------------ [2007-08-29 17:47:58] jpittman2 at gmail dot com Description: ------------ mssql_fetch_* returns 0 instead of NULL when the datatype is "bit". Reproduce code: --------------- <?php $conn = mssql_connect($src, $uid, $pwd); mssql_select_db($db_name); $sql = "SELECT Cast (Null as Bit) As Should_Be_Null," . " Cast (0 as Bit) AS Should_Be_Int_0," . " Cast (1 as Bit) As Should_Be_Int_1"; $result = mssql_query($sql); return mssql_fetch_array($result); ?> Expected result: ---------------- Should return (NULL, 0, 1) Actual result: -------------- returns (0, 0, 1) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=42474&edit=1

« previous php.bugs (#189283) next »