php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #3889 sybase_fetch_array returns a single space instead of empty strings
Submitted: 2000-03-21 12:09 UTC Modified: 2000-07-27 08:36 UTC
From: k at les dot cz Assigned:
Status: Closed Package: Sybase-ct (ctlib) related
PHP Version: 4.0 Latest CVS (21/03/2000) OS: redhat 6.1 (kernel 2.2.12)
Private report: No CVE-ID: None
 [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)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-05-22 04:05 UTC] joey at cvs dot php dot net
Change printf() to var_dump($a)
What result do you get?
 [2000-07-27 00:43 UTC] zak@php.net
Has any progress been made on this bug report?
 [2000-07-27 08:36 UTC] joey@php.net
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.)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC