Re: Re: PEAR DB abstraction layers
| From: | Lukas Smith | Date: | Mon, 19 Apr 2004 13:29:20 +0000 |
| Subject: | Re: Re: PEAR DB abstraction layers | ||
| References: | 1 2 3 4 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-28020@lists.php.net to get a copy of this message | ||
Martin Jansen wrote:
On Mon Apr 19, 2004 at 03:0932PM +0200, Lukas Smith wrote:The difference is as follows: $db->getRow($query, $params, $fetchmode) $mdb2->getRow($query, $types, $params, $param_types, $fetchmode); If you dont want to use the type abstraction then you will need to set $types and $param_types to null. However if you just want to run the query you will have to do the same for both API's: $db->getRow($query) $mdb2->getRow($query); The above example does highlight another difference: MDB[2] only supports the ? placeholder. The DB placeholder ! and & are not supported because this is handled through the $param_types array. Anyways moving the types related params to the end of the parameter list would evade this problem, however I dont think it would be very logical for the enduser. I guess the question is if a wrapper around MDB2 which "hides" all of these features is still not faster than DB (especially when using the unbuffered query mode). regards, Lukas Smith smith@backendmedia.com _______________________________ BackendMedia www.backendmedia.com berlin@backendmedia.com Linn Zwoch Smith GbR Pariser Str. 44 D-10707 Berlin Tel +49 30 83 22 50 00 Fax +49 30 83 22 50 07Aidan Lister wrote:This sounds potentially cumbersome to me and I believe that one of DB's strengths is the straightforward API. So shouldn't we (resp. you) consider to use the "no-types" style per default, so that people don't need to perform wrenches like passing NULL values when using MDB?Is it more complicated to use? I'm looking at all this set-type stuff and I'm thinking "ohh to hard". Is that optional? Is the API less complex than DB?The type stuff is optional. The only difference when you dont want to use the types is that a few parameters will have to be set as "null".