Abstract classes allow developers to write code without looking at the kind of database (only looking at its opportunities and peculiarities of working). It is very useful if you work with two bases simultaneously (you don�t have to remember what to write: mysql_fetch_array or OCIFetchInto).
Database changing is simple too. The only thing you have to do is to change database type in the object initialization.
Normal layout is two classes: connection with base and query result. Actually query result identifier could be kept in the database object (for example in the result array) but for comfort and order results are kept in the separate class.
So, there are five classes.
AdoDB is the most documentary class. There are examples of use. Utilization is simple enough. In the adodb.inc.php file set the database parameters, witch will be used by default.

$db = NewADOConnection();
$db->Connect("localhost", "root", "password", "mydb");
$result = $db->Execute("SELECT * FROM employees");
if ($result === false) die("failed");
while (!$result->EOF) {
  for ($i=0, $max=$result->FieldCount(); $i < $max; $i++)
    print $result->fields[$i]." ";
  print "<br>

If you need Oracle base change second line to ADOLoadCode('oracle'); Program will attach file with class for necessary database by function include_once.
DAC (Database access class).
In the use it is similar to AdoDB. Different databases are supported by child classes, which are connected automatically. Here we have several functions for query carrying out, such as select, insert, update and execute.
class.DBI (Database independent class)
Functions are divided on two (selection and the rest of the queries). If you want to extract files from archive you have to enter class.DBI-....tgz file, then copy class.DBI-0.3.8.tar file to the necessary directory and open it in the UltraEdit. Then with the help of copy/paste enter the code to the necessary base.
Muze Abstract DB.
Here query is sent to the base by query class constructor.
DIOW (Database independent object wrapper).
Here division into the bases is made very strange � if a variable with the database type and such construction:
if ($database_type==1) {
elseif ($database_type==2) {
And there is the most fearful thing. Try it yourself
if ($database_type==2) {
  $this->my_temp_resultID = mysql_query($someSQL, $this->my_connection);
  $this->my_temp_result_object->numrows = mysql_num_rows($this->my_temp_resultID);
  $this->my_temp_result_object->numcols = mysql_num_fields($this->my_temp_resultID);

  // fill column_names from resultset
  for ($j=0; $j < $this->my_temp_result_object->numcols; $j++) {
    $this->my_temp_result_object->column_name[$j] = 
mysql_fieldname($this->my_temp_resultID, $j);

  // fill data elements from resultset
  for ($i=0; $i < $this->my_temp_result_object->numrows; $i++) {
    $x = mysql_fetch_row($this->my_temp_resultID);
    for ($j=0; $j < $this->my_temp_result_object->numcols; $j++) {
      $this->my_temp_result_object->element[$i][$j] = $x[$j];

  return $this->my_temp_result_object;
Before return there are two cycles that take data from base and put them to the array. After that you can do whatever you want with that array but it will take additional memory. Sometimes there appear some situations when database can do nothing with them but it happens rarely. In other ones the only thing you have to do is to get data and enter them to the document. After that line array is changed to the new one similar to previous one. But in our situation it doesn�t happens. Of course you can say that I use models and hold everything in the variable till the end (the final of my scripts is $root->ugh()). But model is another situation. If I attach that class to my models or to another script where I don�t have to hold all data in the array there will be required more memory. If you really want to put the entire query data to the array use another classes. You understand that there won�t be result releasing in the end of the function, because command for finishing return function working has been given. If script that calls several queries calls a lot of users server will have problems.