ID: 15306
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
-Status: Open
+Status: Closed
Bug Type: ODBC related
Operating System: MacOSX 10.1.2
PHP Version: 4.1.1
New Comment:
running your sample script below I don't see the problem. Although the
big differences are I'm on 10.1.4, and PHP 4.3-dev. Please try the
4.2.1 release and see if this continues for you.
Previous Comments:
------------------------------------------------------------------------
[2002-01-30 20:06:35] [EMAIL PROTECTED]
odbc_fetch_row( $cur) called repeatedly without passing the
row argument should retrieve all the rows in a rowset
sequentially. Instead, in my setup, if the query, to which
$cur relates, is a SELECT * FROM ... ORDER BY..., a number
or rows will be dropped (it seems rows for which some
column is not unique in the rowset).
My setup is:
MacOSX 10.1.2 (what a pain to compile php4.1.1 on it!)
DB: OpenLink Virtuoso Lite 2.5
iodbc + Openlink Virtuoso Driver 02.50.2139
php built using:
./configure --prefix=/usr --sysconfdir=/etc --
localstatedir=/var --mandir=/usr/share/man --with-zlib --
with-xml --with-iodbc=/usr/local/odbcsdk --with-apxs < /
dev/null
(note that I had to use the libtool generated under 4.0.6
in order to compile 4.1.1)
and this is the sample script (it includes the workaround,
that is to always pass the $row argument to odbc_fetch_row)
<?php
$conn = odbc_connect("test", "user","pass");
$Query = "SELECT * FROM Bugtable ORDER BY Name";
/* BugTable is:
CREATE TABLE Test.dba.BugTable (
ID int IDENTITY NOT NULL PRIMARY KEY UNIQUE,
Name char (10)
);
*/
//execute query
$cur=odbc_exec($conn, $Query);
$Outer=0;
while( odbc_fetch_row( $cur)){ // this does not
retrieve all
// while( odbc_fetch_row( $cur, ++$Outer )){ // this
does
for($i=1; $i <= 2; $i++){
printf("%s ", odbc_result( $cur, $i ));
}
print "<p>";
}
//disconnect from database
odbc_close( $conn);
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=15306&edit=1