An extremely easy, speedy way to deal with a database from a PHP script. Results are read row by row, as you need them - less demand on memory than loading all result rows
into a single monster array =P. You can seek back and forth for the result row you want at any time.
Includes an abstract base class, and a subclass to work with a MySQL db. Write your own subclass of CDBAbstract to work with any PHP-supported database software!
Changes in 1.2: (by Michael Howitz)
- added support for: Commit, Rollback, SetAutoCommit
- added subclass for oracle (OCI8) support
Changes in 1.2.1: (by Dirk Howard)
added subclass for Postgresql (pgsql) support
This is a class i have been working on. The most important things for me where portability and fast but reliable working.
I would very much appriciate any feedback and pointing out any bugs or bad programing decidions.
I allmost forgot: the class was tested with odbc under win2k and mysql under red hat 7.0. It would be nice if someone could test it with ms sql server (the support for it was
inplemented just with the reffrence from the php manual).
I'm currently working on postgreSql support, so v1.1 could be expected soon.
This DBClass allows a coder not only to easily run SQL queries and catch/log errors in case of failure but also to easily get result data epresented into php arrays or html
tables with a built-in pagination control.
I needed a quick way to switch quickly between MySQL and MS SQL Server for applications, so I wrote two classes, that provide a modular, consistent API that can be used for
either database. Changing out your DB is as easy as dropping in the proper DB_whatever.php file into the dir that DB.php lives in, then changing the $dbtype var before you
require() DB.php
An object orientated database absraction layer. Meant for use with mySQL. Supports persistant and non persistant connections, error handling and customised logging. Designed
to separate application from database logic. Returns all required elements, result resources, rows and field sizes and names.
Class that provides an abstraction layer above the PHP PostgreSQL API. This centralizes all the database connection info such as host, port, username and password. Same class
can be used to connect to multiple databases, local and remote, on different ports.
In addition to "normal" stuff that you'd expect from a db abstraction layer, it also supports transactions and comprehensive error checking/management.
Revision History: *** see class header for revision history ***