logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: MDB questions: msg#00189

Subject: Re: MDB questions
Hello to all,

I had the same problem as Lorenzo Alberton with fetchRow on more than
one result but a slightly different solution and would be interested in
your opinion.

 >5) I tried some queries with MDB, and all worked fine for one-row
 >results. On the other hand, while looping thru a multi-row result I
 >could only fetch the first row.


The lines which cause the problem are:
 > if (!$this->options['autofree'] && $res != NULL) {
 >   $this->freeResult($result); }

I changed the first line to this:
if (!$this->options['autofree'] && $res == NULL) {
so that freeResult is only called, when the query returns no result. IMO
the !$this->options['autofree'] is there to prevent freeResult from
being called a second time, when it is already done in fetchInto. (the
same line in fetchOne, fetchCol and fetchAll also has to be changed)

If this is true, the line
 > if ($this->options['autofree'] && $res != NULL) {
would be no permanent solution.

Thanks for your attention,

Michael


--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>