Re: MDB questions
| From: | Michael Raidel | Date: | Mon, 23 Dec 2002 19:49:32 +0000 |
| Subject: | Re: MDB questions | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-3063@lists.php.net to get a copy of this message | ||
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