Re: PHP Database Abstraction Layer
| From: | Maxim Maletsky | Date: | Thu, 06 Feb 2003 12:33:36 +0000 |
| Subject: | Re: PHP Database Abstraction Layer | ||
| References: | 1 2 | Groups: | php.db php.general |
| Request: | Send a blank email to php-general+get-134587@lists.php.net to get a copy of this message | ||
"Luke Woollard" <luke@taborvision.com> wrote... :
> I once read a great article in the first or second issue of
> http://www.phparch.com/ on database abstraction layers. At
> which point I
> used the tutorial as a starting point for creating a very similar structure
> I named dbWave. There are only minor differences and a postgresql driver is
> now included for the most common pg_* functions.
>
> I was just wondering if anyone has developed a database abstraction layer
> that allows you to separate your SQL queries from your application logic
> like dbWave does? I'm looking for a more advanced way of doing this?
>
>
> Attached is dbWave for anyone to look at/use. To run it you need to use the
> following tags in your file:
>
> // DBWave include files
> include( "[attached_filename].php" );
>
> To instantiate the dbWave object you use the following code in a file name
> connect.php
> <?php
>
> /* This file instantiates dbWave using our chosen API */
> /* It is automatically generated by the database setup program */
>
> // Instantiate dbWave using the MySQL API
> $dbWave = new Mysql();
>
> // Connect to the database
> $dbWave->connect( 'yourhost', 'yourport', 'yourdbname',
> 'yourdbuser',
> 'yourdbpass' );
> ?>
ZoomStats uses it: http://sf.net/projects/zoomstats
P.S: I wrote that phparch article, and I based it on my ZoomStats
experoence which I also founded.
--
Maxim Maletsky
maxim@php.net