Re: pear mdb
| From: | electroteque | Date: | Fri, 24 Jan 2003 21:22:54 +0000 |
| Subject: | Re: pear mdb | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-3456@lists.php.net to get a copy of this message | ||
how bout MDB_FETCHMODE_OBJECT ??
"Lukas Smith" <smith@backendmedia.com> wrote in message
news:000001c2c3ea$2d004070$4d00a8c0@vandal...
> > -----Original Message-----
> > From: electroteque [mailto:daniel@electroteque.org]
> > Sent: Friday, January 24, 2003 9:34 PM
> > To: pear-general@lists.php.net
> > Subject: [PEAR] pear mdb
> >
> > hi there i'm trying to start to use mdb , although the tutorial is
> pretty
> > bad , it dont work , i was wondering if this code below still applies
> ? i
> > cant seem to get it to work or even spit our any debugging errors ,
> > isError
> > wont work
> >
> > while ($row = $query->fetchRow(DB_FETCHMODE_OBJECT)) {
> > echo $row->gallery;
> > }
>
> grmbl. This quick tutorial port is really biting me in the butt. I will
> need to fix it this weekend.
>
> Anyways. No this piece of code will not work anymore, as MDB does not
> support fetching into an object. I decided to drop it because it was
> just eating performance.
>
> If you want to fetch an entire result set I recommend that you use:
> $mdb->queryAll($query, NULL ,MDB_FETCHMODE_ASSOC);
>
> NULL would be where you could optionally pass the types of the colu,ns
> in the result set
>
> MDB_FETCHMODE_ASSOC is optional of course as well ..
>
> Regards,
> Lukas
>
>