|  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
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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
20 + 6 = ?
Subscribe to this entry?

 [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. 


Add a Patch

Pull Requests

Add a Pull Request


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 Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 21 13:01:28 2024 UTC