php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28124 Using MSSQL functions an empty string is returned as a space
Submitted: 2004-04-23 16:15 UTC Modified: 2004-04-23 17:44 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: cbunk at arescorporation dot com Assigned:
Status: Not a bug Package: MSSQL related
PHP Version: 4.3.6 OS: Windows 2000
Private report: No CVE-ID: None
 [2004-04-23 16:15 UTC] cbunk at arescorporation dot com
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: 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-23 17:44 UTC] iliaa@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

This is the bug in the mssql library you are using.  
P.S. This issue has been discussed in detail in earlier bug 
reports about the same issue, please search the bug 
archives. 
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun Dec 04 08:03:43 2022 UTC