Re: DB stuff

From: Date: Mon, 26 Mar 2001 23:20:31 +0000
Subject: Re: DB stuff
References: 1 2 3 4  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-106@lists.php.net to get a copy of this message
["Colin Viebrock" <colin@easyDNS.com>] > > The fetchmode has to be hardcoded to DB_FETCHMODE_ASSOC here, or your > > object won't contain much. Also, if fetchInto() returns an object, an > > error should be raised. :-) > > I understand your first comment ... yeah, I meant to say that. :) > > I don't understand the last point though. If fetchInto() *does* return > an object, are we using that as the indication there was an error? > Instead of: > > if (is_object($res)) { > > Why not: > > if ($res !== DB_OK) { > > (Although there is a condition where the fetchInto will fail, and return > NULL instead of an error ... don't know how we want to catch that) What I meant was that fetchInto() is documented to return an array, not an object. :-) > > If "->" somehow pleases you more than "[]", fine. I still > > don't see > > the point in having objects without methods instead of assocs. :-) > > Yeah, well ... it's mostly a back-porting thing. I agree that there is > no advantage, except it makes code look a bit cooler sometimes. ;) 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? - Stig -- Stig Sæther Bakken <ssb@fast.no> Fast Search & Transfer ASA, Trondheim, Norway

« previous php.pear.dev (#106) next »