|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-03-11 09:19 UTC] sniper@php.net
[2004-03-16 11:59 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 17:00:01 2025 UTC |
Description: ------------ I am working on porting phpbb over to DB2, and ran into an error with odbc_fetch_row. When the following SQL is executed: ?SELECT * FROM phpbb_fourms WHERE forum_id = 1? odbc_fetch_row($result_id, $i) returns false. Where i = 1. Sending the query to the database returns one row. When I remove the $i from odbc_fetch_row it works perfectly. Also if more than one result is returned there is no problem. Also it seems to only occur when there is a select * or when there is a large number of columns returning a single row. I am pretty sure I have experienced this bug since the early 4.0.* days. Reproduce code: --------------- $i = 1; $k = 0; while(odbc_fetch_row($result_id, $i) && $k < $this->result_numrows[$result_id]){ for($j = 1; $j < count($this->result_field_names[$result_id])+1; $j++){ $this->result_rowset[$result_id][$k][$this->result_field_names[$result_id][$j-1]] = odbc_result($result_id, $j); } $i++; $k++; } Expected result: ---------------- Expected odbc_fetch_row($result_id, $i) to return true. Actual result: -------------- odbc_fetch_row($result_id, $i) returned false if just one row was selected from the database. If more than one row was selected it returned true and worked fine. Removing the $i from odbc_fetch_row() fixed the problem. None the less it is still appears a bug. I also verified that the database query does return one result.