Re: DB stuff
| From: | Colin Viebrock | Date: | Mon, 26 Mar 2001 23:32:27 +0000 |
| Subject: | Re: DB stuff | ||
| References: | 1 2 3 4 5 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-107@lists.php.net to get a copy of this message | ||
> What I meant was that fetchInto() is documented to return an array,
> not an object. :-)
Ah. All is clear now. But, you should also see my post about using:
if ($res !== DB_OK) {
to check for errors, instead of seeing if fetchInto returns an object.
> Would it be useful if you could also specify what class of object you
> want to fetch the data into? Do you see any nice uses for that?
Hmmm, I think that could be very useful. Say you had a database of user
information (name, address, etc). You can fetch that into the "users"
class you've created, and you are ready to go with the new instance of the
class, including all the fancy methods you coded.
Almost like a fetch and bless? :)
- Colin