PHP 4.0 Bug #4502: sybase_fetch_row stops before getting all rows
| From: | salim at sdv dot fr | Date: | Thu, 18 May 2000 13:23:20 +0000 |
| Subject: | PHP 4.0 Bug #4502: sybase_fetch_row stops before getting all rows | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-18917@lists.php.net to get a copy of this message | ||
From: salim@sdv.fr
Operating system: Linux RH 6.2
PHP version: 4.0 Release Candidate 2
PHP Bug Type: Sybase (dblib) related
Bug description: sybase_fetch_row stops before getting all rows
compile line : --with-apxs=/usr/local/apache/bin/apxs --with-sybase=/opt/sybase-11.9.2
Description:
I do a select using sysbase_query which is supposed
to return 2107 rows .
When I loop on sybase_fetch_row, I stops before 400 rows.
In fact the number is totally random, I got between
6 rows and 300 ..
Nota:
The remote server is a SqlServer 7.0
I used sybase server libraries but the problem occurs
if I use freetds sybase libs.
Most important, everything is fine when using php3.
with both sybase libs.
The script:
<html>
<body>
<?
function Error( $msg, $db )
{
echo "$msg \n";
sybase_close( $db);
exit();
}
$db=sybase_connect('sqlserver','user','pass');
if(!$db) Error("Error in sybase_connect",$db);
$cur=sybase_query("select * from test",$db);
if(!$cur) Error( "Error in sybase_query",$db);
echo "<table border=1><tr><th>value</th></tr>\n";
$nbrow=0;
while($row=sybase_fetch_row($cur))
{
echo "<tr><td align=center>$row[0]</td></tr>\n";
$nbrow++;
}
echo "<tr><td>$nbrow entries</td></tr></table>";
sybase_close($db);
?>
</body>
</html>