From:             cbunk at arescorporation dot com
Operating system: Windows 2000
PHP version:      4.3.6
PHP Bug Type:     MSSQL related
Bug description:  Using MSSQL functions an empty string is returned as a space

Description:
------------
When making a query on a MSSQL DB using mssql functions an extra space is
added to the end of output.  This is causing trouble with scripts of mine
that check to see if the querried field is empty to determine whether or
not to display some text.

The bug mentioned at
http://bugs.php.net/bug.php?id=25777
describes the problem but was marked as bogus.  I think when the fix for
http://bugs.php.net/bug.php?id=25777 was made it in advertently left an
extra space in results.

Reproduce code:
---------------
//once connected to the db
$sql="Select name from contacts";
$result=mssql_query($sql);
$row = mssql_fetch_array($result);
//assume there is one entry in the table 
//with an empty string as the value for 
//name
if (!empty($row["name"])){
  echo "Name: " . $row["name"];
}else{
  echo "Name value is empty";
}

Expected result:
----------------
Name value is empty

Actual result:
--------------
Name: 

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

Reply via email to