php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34096 space returned instead of null
Submitted: 2005-08-12 12:57 UTC Modified: 2005-08-14 21:34 UTC
From: jelenkovic at siol dot net Assigned:
Status: Not a bug Package: MSSQL related
PHP Version: 4.4.0 OS: Windows XP SP2
Private report: No CVE-ID: None
 [2005-08-12 12:57 UTC] jelenkovic at siol dot net
Description:
------------
the mssql query keeps returning a space value instead of NULL or EMPTY on a nvarchar field which is clearly EMPTY.
This bug has been reported before.Has been marked as closed.
The posts bellow it still say it shouldn't be closed since this is an actual bug.
And since i don't see the logic in making me check every field for a space value...i'm gonna call this a bug also.
Unless someone knows how to configure PHP to stop acting this way.

Oh i use php ADODB...which is not responsible for this problem.

tested on the following SQL SERVERS..before you scream "wrong mssql library"

a)Microsoft SQL Server  2000 - 8.00.760 (Intel X86)   Dec 17 2002 14:22:05   Copyright (c) 1988-2003 Microsoft Corporation  Desktop Engine on Windows NT 5.1 (Build 2600: Service Pack 2) 

b)Microsoft SQL Server  2000 - 8.00.2039 (Intel X86)   May  3 2005 23:18:38   Copyright   1988-2003 Microsoft Corporation  Standard Edition on Windows NT 5.2 (Build 3790: Service Pack 1) 

and the php version is 4.4.0 so there is no "old version" problem here.

Reproduce code:
---------------
$query="SELECT * FROM users where username='$username' AND id='$userid'";
$db->SetFetchMode(ADODB_FETCH_ASSOC);
$results = $db->GetAll($query);
foreach ($results as $data)
{
$id= $data["id"];
$city = $data["city"];
if($city=="") { echo "$id)AAAAAAAAAAAAAAAAAAAAAAA<br>"; }
}
dbclose();

Expected result:
----------------
AAAAAAAAAAAAAAAAAAAAAAA where the city field is empty?

Actual result:
--------------
NOTHING

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-12 15:45 UTC] sniper@php.net
See bug #29292
 [2005-08-14 11:13 UTC] jelenkovic at siol dot net
ok i read all that and where exactly is the so called fix?
you all keep blaming some outdated mssql librabry but i clearly stated that i am using THE LATEST VERSION OF MSSQL 2000...SP3 the LATEST VERSION OF PHP and i still get the empty space.
so what is one to do.Use 10.000 other library versions and figure this out by themselves because you say this is BOGUS but don't provide any way to fix it?
All the old versions keep comming up with this bug then the bug is being "fixed in CVS" any yet it's still here.
 [2005-08-14 11:16 UTC] jelenkovic at siol dot net
i'm going to try everything in the comments because i believe you're right.But perhaprs this should be documented somewhere in the readme file.
thanks
 [2005-08-14 11:34 UTC] jelenkovic at siol dot net
ok the ntwdblib.dll version is 2000.80.194.0.
so once again there is no old library version.
there is no compatibility_level problem.

so besides pasting links to OLD version "fixes" which apply to only some users that had luck in getting it to work.CAN someone write down what exactly one has to do when they have the latest versions of libraries?(or do you have even newer ones).
do you expect one to downgrade their system with your outdated ntwdblib.dll library?
Can someone please write down a solution which proves that his bug is "bogus"
 [2005-08-14 21:34 UTC] sniper@php.net
Stop reopening a bogus bug. There is no fix, blame mickeysoft.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 14:01:32 2024 UTC