Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.3.0

Bug #633 "ORA-01002 Fetch Out Of Sequence" error
Submitted: 2004-01-27 14:54 UTC
From: thierry dot bo at netcourrier dot com Assigned: lsmith
Status: Closed Package: MDB
PHP Version: 4.3.2 OS: Win32 XP
Roadmaps: (Not assigned)    
Subscription  


 [2004-01-27 14:54 UTC] thierry dot bo at netcourrier dot com
Description: ------------ Hi, With latest MDB1.* branch cvs files, I got this specific error with oci8 driver : "php(1538): ocifetchinto(): OCIFetchInto: ORA-01002 Fetch Out Of Sequence in oci8.php line 1538". Switching to mysql driver and mssql driver I got no error. Reproduce code: --------------- $sql = "SELECT room_name, capacity, id FROM mrbs_room WHERE area_id=$area ORDER BY 1"; $types = array('text', 'integer', 'integer'); $res = $mdb->query($sql, $types); $counte = $mdb->numRows($res); if (0 == $counte) { echo "<h1>$vocab[no_rooms_for_area]</h1>"; $mdb->freeResult($res); } else { $room_column_width = (int)(95 / $counte); >>>> while ($row = $mdb->fetchInto($res)) <<<<ERROR { echo "<th width=\"$room_column_width%\">" . htmlspecialchars($row[0]) . "($row[1])</th>"; $rooms[] = $row[2]; } }

Comments

 [2004-01-27 21:24 UTC] thierry dot bo at netcourrier dot com
Variables values : this nil $result_value 20 $rownum 2 $result nil $buffer NULL
 [2004-01-28 13:43 UTC] thierry dot bo at netcourrier dot com
After some investigations, I found this: Although the error itself is not in the oci8 $mdb->numRows() function, the bug I reported only occurs if I call $mdb->numRows() before. I commented this function in some places in my code just before the fetchInto call and I did not get the error.
 [2004-01-28 16:02 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2004-01-28 17:59 UTC] thierry dot bo at netcourrier dot com
I did not set this option, so I see default is FALSE. I think I understand why there is an error, even if I don't undestand why. I tried this: I filled 'mrbs_room' table with only ONE row in MySQL and Oracle. With Mysql, the >> while ($row = $mdb->fetchInto($res)) << loop is executed once, normal. But with Oracle, the loop is executed twice! Hence, there is no error during the first loop, the error occurs when the second fetchInto() is executed. Again, the table contains only ONE row.
 [2004-01-29 01:09 UTC] thierry dot bo at netcourrier dot com
Follow-up. If I remove the call to numRows() before, the 'while' loop is executed one times as expected.
 [2004-02-03 19:14 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2004-03-21 18:07 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2004-03-24 12:35 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2004-03-31 15:54 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!