This is something that PHP has always lacked.  Its also something that I
have always found to be the most attractive about application servers like
Allaire's Cold Fusion (  The ability to totally
abstract database access makes it much easier on the developer and
transparent to the end-user.

While I agree that there are high maintenance costs, I still believe that
its worth it in this case.  For an initial offering, a subset of DB
functionailty would be needed, something that all of the databases offer,
for example:

1) $connection_id = db_connect( $host_string );
2) $query_result  = db_query( $query );
3) $query_row     = db_fetch_row( $query_result );
4) void             db_close( $connection_id );

(Perhaps $host_string is the identifier for some defined datasource in the
php.ini or .htaccess files)

This abstraction (any abstraction for that matter) would open up the doors
for quite a number of interesting capabailities.  For example, a flatfile
"driver" that would be queried, or a google "driver."

PEAR is fine for most people (myself included) but from an efficiency
standpoint, this would be much better handled from the PHP API level, and
not from the PHP language level.

In any case, I am more than willing to help out in any way that I can.

Sean Bright

> -----Original Message-----
> From: Manuel Lemos [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, February 04, 2001 2:12 PM
> Subject: Re: [PHP-DEV] database abstraction layers [from:
> MySQLfeature/bug]
> Hello Mark,
> On 31-Jan-01 16:33:56, you wrote:
> >>> I have been crafting my own database abstraction layer,
> and in doing so
> >>> create an array of the results of a query.
> >>
> >> Is this an db abstraction layer written in php (script),
> or written as a
> >> module for php (C)?
> >>
> >> I was thinking of writing an (open source) db-abstraction
> module (that uses
> >> existing db-modules, of course), which could then be used
> from php-script
> >> as well as from other modules that need db-functionality
> without committing
> >> to a specific database.
> >>
> >> Or, does such a module exist already and should I
> concentrate on using
> >> and/or co-developing that one?
> >I'd be open to turning it into C, as all my layer is really
> doing at its
> >core is to do every single bit of error checking and API
> utilization for all
> >the different DB drivers present on the system.
> Before trying to re-invent the wheel, maybe you would like to
> take a look
> at Metabase.  It is not yet written in C, but nothing stops
> it from being
> converted. Unlike others it assures inter-database
> application portability.
> >What I've seen of PHPLIB and PEAR's DB function don't
> interest me. I hardly
> >see the point of using objects to do the work that a general
> function would
> >do just as well and without any need to instantiate it.
> Objects are important to interface with different database
> drivers using
> the same API, but yes for the public API objects are not
> needed, they are
> really confusing for less experienced programmers and they are also a
> problem for PHP3 users (yes, a lot of PHP developer can't or
> don't want to
> move to PHP 4).
> >I need to spend some time with the Zend API to see if it's
> really worth it
> >for my time to go about doing it, but yes, I am very much considering
> >turning it into C.
> I doubt that it is worthy, not just because of the conversion
> risks but also
> the maintenance costs.
> Instead, if you would like to join and contribute of
> Metabase, look here
> for this poll and tell how would you like to participate.
> Metabase is available for free and over 4.000 unique PHP
> users downloaded
> it from here:
> There are several ready to use components based on Metabase
> like this for
> browsing query results:
> or even full application frameworks like Binary Cloud:
> Regards,
> Manuel Lemos
> Web Programming Components using PHP Classes.
> --
> URL:
> PGP key:
> --
> --
> PHP Development Mailing List <>
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail:

PHP Development Mailing List <>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to