php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #641 Extra whitespace when SELECTing a text field
Submitted: 1998-08-10 14:24 UTC Modified: 1998-08-13 16:02 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: cbi at allgaeu dot org Assigned:
Status: Closed Package: Sybase (dblib) related
PHP Version: 3.0.2a OS: Linux 2.0.34
Private report: No CVE-ID: None
 [1998-08-10 14:24 UTC] cbi at allgaeu dot org
I noticed that sometimes PHP seems to append some extra whitespace to fields selected from a MS-SQL-database. I wasn't able to find out WHY it happens, but I am pretty sure I am able to reproduce this behavior.

Sybase Open/C client 10.0.3, Apache 1.3.1

The problem: I SELECT a field from the Database:

$res = sybase_query("select name from item",$db);
$result = sybase_fetch_array($res);

and when I try $result["name"] or $result[0] it contains

"blbla                          " <--- extra whitespace

I am sure that there are no blanks behind the words in the database. The length of the whole string is IMHO approximately equal to the length of the field in the database.  It is a littel bit strange that it happens only sometimes but when it happens, I can always reproduce it. When SELECTing more than one row not every field has extra whitespace. 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-08-13 16:02 UTC] zeev
No response from the user.
This is standard SQL behavior.  If this doesn't seem right, please get back to us at php-dev@lists.php.net.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Oct 25 03:01:24 2020 UTC