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

From: Date: Fri, 31 Aug 2007 13:57:06 +0000
Subject: #42474 [Opn->Asn]: 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-116929@lists.php.net to get a copy of this message
ID: 42474 Updated by: fmk@php.net Reported By: jpittman2 at gmail dot com -Status: Open +Status: Assigned Bug Type: MSSQL related Operating System: Windows 2003 (5.2) PHP Version: 5.2.3 -Assigned To: +Assigned To: fmk 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 http://bugs.php.net/?id=42474&edit=1

« previous php.bugs (#116929) next »