Re: DB Package with Oracle and SELECT * FROM
| From: | Craig Constantine | Date: | Tue, 13 Dec 2005 18:33:00 +0000 |
| Subject: | Re: DB Package with Oracle and SELECT * FROM | ||
| References: | 1 2 3 4 5 6 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-22244@lists.php.net to get a copy of this message | ||
--On Tuesday, December 13, 2005 6:36 PM +0100 Franck Collins
<franck@collins.fr> wrote:
>>> with the query: "SELECT title, country FROM table_test",
>>> the script don't show the error but it continue to run... It never stop
>>> and
>>> never show the result! Very strange
>>
>> Can you post (or just email me) the code you're running? (I started
>> following-along/helping in the middle of your conversation, and I don't
>> think I've seen any code.)
>> -c
> Ok, here is my code:
[snip]
> while ($row =& $res->fetchRow()) {
> echo "Val -> " . $row[0] . "<br />";
> }
try...
while ( is_array($row =& $res->fetchRow() ) { ...
fetchRow() returns mixed... maybe its returns a DB_Error object; that might
evaluate to true and mask the fact that there's a problem...
when you fall off teh while() check if $row is null (done successfully), or
a DB_Error object to see why you fell off...
HTH
-c