<?php
require_once('DB.php');
$username = "john";
$password = "foobar";
$host = "localhost";
$db_name = "mydb";
$dsn = "mysql://$user:$pass@$host/$db_name";
$db = DB::Connect($dsn);
if(DB::isError($db)) {
die($db->getMessage());
}
$result = $db->query("SELECT * FROM clients");
if(DB::isError($result)) {
die($db->getMessage());
}
/* Fetch as an indexed array... */
$row = $res->fetchRow(DB_FETCHMODE_ORDERED);
/* Fetch as an associative array... */
$row = $res->fetchRow(DB_FETCHMODE_ASSOC);
/* Fetch as an object... */
$row = $res->fetchRow(DB_FETCHMODE_OBJECT);
$result->free();
$db->disconnect();
?>