From:             jmelville at selectaustralasia dot com dot au
Operating system: Windows 2000 Server SP4
PHP version:      4.3.8
PHP Bug Type:     MSSQL related
Bug description:  Single space character returned instead of empty string

Description:
------------
Upgraded an existing server from PHP 4.3.2 to 4.3.8, Apache 1.3 on Windows
2000 SP4. Database is SQL Server 2000 SP4 on the same machine.

All SQL queries that previously returned an empty string (e.g. the varchar
column in the database contains an empty string and is not NULL) now return
a single space character. I've confirmed in Query Analyser that the fields
are definitely empty.

Note the sample uses mssql_fetch_object() but I've also checked
mssql_fetch_array() and it does the same thing.

This is the same as bug #9854 but that bug is closed and refers to PHP
4.0.x, whereas this server has never run anything older than 4.3.x

Thanks,

Julian.


Reproduce code:
---------------
$sql = "SELECT TOP 5 * FROM jobs;
$rs = mssql_query($sql);
while ($job = mssql_fetch_object($rs))
{
  print "rec_id: '$job->rec_id' fax: '$job->fax' \n";
}


Expected result:
----------------
rec_id: '45336' fax: '' 
rec_id: '40659' fax: '09 379 7785' 
rec_id: '44934' fax: '' 


Actual result:
--------------
rec_id: '45336' fax: ' ' 
rec_id: '40659' fax: '09 379 7785' 
rec_id: '44934' fax: ' ' 


-- 
Edit bug report at http://bugs.php.net/?id=29292&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29292&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29292&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=29292&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=29292&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=29292&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=29292&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=29292&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=29292&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=29292&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=29292&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=29292&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=29292&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29292&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=29292&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=29292&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=29292&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29292&r=float

Reply via email to