php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2874 Cast needed for sybase_fetch_array
Submitted: 1999-11-30 16:32 UTC Modified: 2000-05-22 03:45 UTC
From: peter at mediasvar dot se Assigned:
Status: Closed Package: Sybase-ct (ctlib) related
PHP Version: 4.0 Beta 3 OS: Solaris 2.6
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: peter at mediasvar dot se
New email:
PHP Version: OS:

 

 [1999-11-30 16:32 UTC] peter at mediasvar dot se
This is a sample for PHP4 b3. How come these errors occours?
$j and $k should be equal but they are not. only $j works. should it really be this way?
in the php3-way you didn't need to cast.

-- CUT --
<?
$sql = "select * from linkdb_intresse where id<10";
$res = sybase_query($sql,$conn);
	
$i=0;
while ($rs = sybase_fetch_array($res))
{
	if ($i++ == 0) {
		$j = (string) $rs[1];
		$k = $rs[1];
	}
	echo $j.", ".$k."<BR>";
	// $j and $k should be equal but they are not. only $j works. should it really be this way?
	// in the php3-way you didn't need to cast.
}

/*
Sample output:
-- CUT --
Test1, Test1
Test1,
Test1,
Test1,
Test1, Test2
Test1,
Test1,
Test1,
Test1, Test3
-- CUT --
*/
?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-03-09 20:52 UTC] joey at cvs dot php dot net
Could you provide me with a sample of the data
and metadata needed to test your example script?
I cannot seem to reproduce this one.
 [2000-05-22 03:45 UTC] joey at cvs dot php dot net
No feedback.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Jul 23 13:01:26 2019 UTC