This module is a wrapper for the PEAR DB class. It allows you to connect directly to any database that PHP supports.

Typical usage of this module would be something like this:

<pinp>
  import("mod_db.php");
  $db=DB::connect("mysql://user@localhost/database");
  if (DB::isError($db)) { 

     echo DB::errorMessage($db);

  } else {

    $db->setFetchMode(DB_FETCHMODE_OBJECT);
    $query="select * from MyTable";
    $result=$db->query($query);

    if (DB::isError($result)) {

      echo DB::errorMessage($result);

    } else {

      // do something with the results

    }
  }
</pinp>

See the documentation for PEAR DB, at the pear.php.net website for more information. And remember that if you use SQL with user supplied values, you must filter these values.