|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2000-09-04 06:44 UTC] lenar at city dot ee
When fetching a record from sybase with sybase_fetch_row
and some fields contain no value ("") then in resulting array there are spaces instead.
list($space) = sybase_fetch_row(sybase_query("SELECT phone FROM users WHERE LENGTH(phone) = 0"));
now $space == " ".
This is not what I want. I want strlen($space) == 0.
Hope this bug will be fixed.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 05:00:01 2025 UTC |
Just to document: In the Sybase documentation manual "SQL Reference: Datatypes and System Tables", on page 7-27: The empty string ("") is treated as a single space. In *char* and *nchar* *not null* columns, the result is a (column-length) field of spaces. You can get around this by adding rtrim(field) in place of field in the select clause.