[ale] DB abstraction for PHP

John Wells jb at sourceillustrated.com
Sun Dec 29 21:55:36 EST 2002


Truly, that's not abstraction.  Abstraction would allow you to drop a
database in behind the scenes and use the same code.

In other words, abstracted db connection code would look something like this:

$dbcon = new Connection($server, $user, $pass);

no matter what database your were making a connection to.  The abstraction
class/lib would take care of the details.

Using PHP's built-in functions, it looks like:

--mysql--
$dbcon = mysql_connect ( $server, $user, $pass);
--oracle--
$dbcon = Ora_Logon("$user@$server", $pass);

See the difference?

I'm aware of PearDB, but am curious as to what other solutions exist.

Thanks,

John


Christopher Bergeron said:
> PHP has it's own pseduo-abstraction DB layers built in.  Depending on
> how you build php, you can build it with:
> mysql support:  --with-mysql
> sqlserver:  --with-sybase (i think; definately double czech this one)
> oracle: not sure; but i _know_ it's possible
> prostgres:  --with-pgsql
>
> I had a nightmare of a build trying to build php with DB2, sybase,
> mysql, flash, pdf, GD, ssl, ldap, etc... but it was a hell of a learning
>  experience.  PHP is a _great_ language, and once you get it built
> right,  the db interfacing is cakewalk...
>
> -CB



_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale






More information about the Ale mailing list