php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39267 mssql_fetch_object bit error null value
Submitted: 2006-10-26 15:51 UTC Modified: 2016-10-15 23:08 UTC
Votes:5
Avg. Score:4.6 ± 0.8
Reproduced:4 of 4 (100.0%)
Same Version:1 (25.0%)
Same OS:3 (75.0%)
From: renatobanzai at gmail dot com Assigned:
Status: Wont fix Package: MSSQL related
PHP Version: 5.1.6 OS: Windows 2003 Server
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: renatobanzai at gmail dot com
New email:
PHP Version: OS:

 

 [2006-10-26 15:51 UTC] renatobanzai at gmail dot com
Description:
------------
When I use the mssql_fetch_object() function with a bit column, if the column has NULL value, the function returns 0.
 

Expected result:
----------------
I think the mssql_fetch_object function must returns null value (empty  value, same numeric columns when null the function returns "")


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-10-19 00:28 UTC] antoniadonoso at msn dot com
i have the same problem, my php version is 5.2.6 ans MSSQL 2000.
I see that the problem is mssql_fetch_array, mssql_fetch_row and mssql_fetch_object.  When you have a bit variable with null value those functions retuns cero, not NULL.
My problem has been resolved as simple sql query before a complete sql query final. by example.

$query="select * from table where column = '$column'  and Bit_Column is NULL ";
$qt=mssql_query($query,$dbhandle);
if (mssql_rows_affected($dbhandle)  <> 1)
{
header("Location: resumen.php");
}

Simple, but effective.
Regards Antonia.
 [2014-12-29 01:05 UTC] kalle@php.net
-Status: Assigned +Status: Open -Assigned To: fmk +Assigned To:
 [2016-10-15 23:08 UTC] kalle@php.net
-Status: Open +Status: Wont fix
 [2016-10-15 23:08 UTC] kalle@php.net
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.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon May 12 04:01:29 2025 UTC