|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2000-03-21 12:09 UTC] k at les dot cz
sybase_fetch_array returns a single space instead
of empty strings.
example:
1, sql commands
create table test (name text)
go
-- inserting an empty string
insert into test ('')
go
2, php script:
# first connect, select...
$query = "SELECT * FROM test";
$rc = sybase_query($query, $link);
while ($a = sybase_fetch_array($rc)) {
printf("<TT>'%s'</TT><BR>\n", $a['name']);
}
3, output of this script:
' '
(one space)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 21:00:01 2025 UTC |
This is the proper behavior. Sybase is at fault here, not PHP. Try the following from isql to see this: create table test (name varchar(15) null) go insert test values ("") go insert test values (NULL) go select * from test go select 'x'+name+'x' from test go (Thanks to dean.bennett@home.com for the answer and test case.)