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
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:
MUST BE VALID
Solve the problem:
50 - 29 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 21:01:36 2024 UTC