Re: db asbstraction

From: Date: Thu, 25 Jan 2001 22:10:36 +0000
Subject: Re: db asbstraction
References: 1  Groups: php.pear 
Request: Send a blank email to php-pear+get-1173@lists.php.net to get a copy of this message
# my way $DB = new DB(); $DB->connect($host,$db,$user,$pass); $DB->query("SELECT name FROM table"); if ($DB->numrows()>0) { while ($DB->fetchRow()) { echo $DB->field('name'); } }
ok. and what do you do if someone is working on several result set concurrently? PEAR is fine then, you are not.
I'm just wondering if I'm missing something, or if this is indeed how PEAR was meant to work.
I guess this is intended and at least similar to what I would have done, in fact I have done this by moving query rewriting (to emulate num_rows, delete tables, get field names on different databases etc.), fetching multi-dimensional result sets, browsing result sets etc. into a complete separate class to not to be forced to use query objects in the main db wrapper, but I ended up extending the main wrapper with a method returning a query object from the query extension class as PEAR does now :) 2c -- · André Langhorst · t: +49 571 3201801 · · waldschrott@php.net · m: +49 173 9558736 · · PHP Quality Assurance · http://qa.php.net ·

« previous php.pear (#1173) next »