Re: DB.php bug with oci8
| From: | Paul Rees | Date: | Tue, 27 Mar 2001 17:37:38 +0000 |
| Subject: | Re: DB.php bug with oci8 | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-117@lists.php.net to get a copy of this message | ||
In article <3AC0CB5F.4BDD84A7@idecnet.com>, Tomas V.V.Cox
<cox@idecnet.com> writes
>Paul Rees wrote:
>> The fetchRow() function in the latest DB.php (1.54) is broken with my
>> Oracle. This kind of code:
>>
>> $sql = "SELECT * FROM table_name WHERE whatever = whatever";
>>
>> if (DB::isError ($result = $db_con -> query ($sql)))
>> echo DB::errorMessage($result);
>> else
>> while ($resultRow = $result -> fetchRow())
>> {
>> echo $resultRow[0] . '<BR>';
>> }
>>
>> ... retrieves the desired results, then produces this error:
>>
>> Warning: Undefined index: in /usr/local/lib/php/DB/common.php on line
>> 127
>>
>> ... once, then this one:
>>
>> Warning: Undefined offset: 1002 in /usr/local/lib/php/DB/common.php on
>> line 127
>>
>> ... in an infinite loop until the script dies.
>>
>> Simply replacing the fetchRow() function with the same one from DB.php,
>> 1.53 fixes the problem.
>The problem is that the fetchrow() was corrected with your patch, but
>the fetchInto() was not updated. Now, fetchrow() is deprecated and all
>the "fetch row work" is done by fetchInto().
>
>The real solution to that problem is to fix the fetchInto() from
>oci8.php.
>
>I think something like replacing:
>if (!($arr && $moredata)) {
> return $this->oci8RaiseError($result);
>}
>
>With:
>if (!$moredata) {
> return NULL;
>}
>
>
>Tomas V.V.Cox
>
Hi Tomas,
Yes, your solution is working for me. Thanks.
All the best,
--
Paul Rees