tell me what it needs and what needs to be added or changed...

class DBO{


const ERR_SILENT            = 0;
const ERR_WARNING           = 1;
const ERR_EXCEPTION         = 2;

const FETCH_ASSOC           = 3;
const FETCH_BOTH            = 4;
const FETCH_OBJ             = 5;
const FETCH_NUM             = 6;
const FETCH_CLASS           = 7;

const PARAM_STR             = 8;
const PARAM_NULL            = 9;
const PARAM_INT             = 10;
const PARAM_BOOL            = 11;
const PARAM_LOB             = 12;

private $_error_mode        = 2;
private $_error_last        = '';
private $_query_last        = '';
private $_results_last      = '';
private $_affected_rows     = 0;
private $_columns_count     = 0;
private $_query_count       = 0;
private $_results_count     = 0;
private $_statements        = array();
private $_connect_persitent = false;



/**
*  
*  @param $driver: the name of the supported driver type
*  @param $dbname: the name of your database
*  @param $server: the server your database is hosted on, most of the time it is localhost
*  @param $user: your database username used to login to your database
*  @param $pass: your database password used to login to your database
*  @example $db = new DBO('mysql' , 'your_database_name' , 'localhost' , 'your_username' , 'your_password'); 
* 
**/
public function __construct($driver = '' , $dbname = '' , $server = '' , $user = '' , $pass = ''){

	$this->_params = array($driver , $dbname , $server , $user , $pass);

	foreach($this->_params as $params){
		if(!is_string($params)){
			if($this->_error_mode === 0){
				return false;
			}elseif($this->_error_mode === 1){
				trigger_error('Argument Error: seems one or more of the supplied arguments is not a '
				              .'string type only string types are expected by DB __construct. File:');
			}else{
				throw new DBO_Exception('Argument Error: seems one or more of the supplied arguments is not a '
				              .'string type only string types are expected by DB __construct. File:');
			}
		}
	}

	$this->connect($this->_params[0], $this->_params[1], $this->_params[2],$this->_params[3],$this->_params[4]);
}


/**
*
*  @param $driver: the name of the supported driver type
*  @param $dbname: the name of your database
*  @param $server: the server your database is hosted on, most of the time it is localhost
*  @param $user: your database username used to login to your database
*  @param $pass: your database password used to login to your database
*  @example $db = new DBO('mysql' , 'your_database_name' , 'localhost' , 'your_username' , 'your_password'); 
* 
**/
protected function connect($driver , $dbname , $server , $user , $pass){
	if(strtolower($driver) === 'mysql'){
		try{
			$this->_lid = new PDO($driver.':host='.$server.';dbname='.$dbname , $user , $pass);
		}catch(PDOException $pdo_error){
			if($this->_error_mode === 0){
				return false;
			}elseif($this->_error_mode === 1){
				trigger_error('Database Error: '. $pdo_error->getMessage());
				$this->_error_last = array(
					'message' => $pdo_error->getMessage() ,
					'file'    => $pdo_error->getFile(),
					'line'    => $pdo_error->getLine(),

				);

			}else{
				throw new DBO_Exception('Database Error: '. $pdo_error->getMessage());
			}
		}
	}elseif(strtolower($driver) === 'pgsql'){
		try{
			$this->_lid = new PDO($driver.':dbname='.$dbname.';host='.$server, $user , $pass);
		}catch(PDOException $pdo_error){
			if($this->_error_mode === 0){
				return false;
			}elseif($this->_error_mode === 1){
				trigger_error('Database Error: '. $pdo_error->getMessage());
			}else{
				throw new DBO_Exception('Database Error: '. $pdo_error->getMessage());
			}
		}
	}elseif(strtolower($driver) === 'sqlite'){
		try{
			$this->_lid = new PDO($driver.':dbname='.$dbname);
		}catch(PDOException $pdo_error){
			if($this->_error_mode === 0){
				return false;
			}elseif($this->_error_mode === 1){
				trigger_error('Database Error: '. $pdo_error->getMessage());
			}else{
				throw new DBO_Exception('Database Error: '. $pdo_error->getMessage());
			}
		}
	}

	return $this->_lid;
}


/**
*  @param $statement: the query string
*  @param $params: the input parameters you can pass to the statement
*  @example $db->query("SELECT column FROM table WHERE column = :something" , array(":something" => "7")); 
*  @example $db->query("SELECT column FROM table WHERE column = ?" , array("7"));
* 
**/
public function query($statement = '' , array $params = array()){
	if(count($params) > 0){
		return $this->prepare($statement)->execute($params);
	}else{
		return $this->prepare($statement)->execute();
	}

	return false;
}


/**
*  @param $statement: the name of the supported driver type
*  @example $db->prepare("SELECT column FROM table")->execute(); 
*  @example $db->prepare("SELECT column FROM table WHERE column = ?")->execute(array('name'));
* 
**/
public function prepare($statement = ''){
	if(!is_string($statement)){
		if($this->_error_mode === 0){
			return false;
		}elseif($this->_error_mode === 1){
			trigger_error('Argument Error: prepare expects only a string type');
		}else{
			throw new DBO_Exception('Argument Error: prepare expects only a string type');
		}
	}

	$this->_query_count++;
	$qid = $this->_query_count;
	$transaction = $this->_lid->prepare($statement);
	$this->_statements[$qid] = $transaction;
	return $this;
}



    Sorry for the double posting but the class was to long for the text limit so here is the second half of the same class.

    	/**
    	*  Execute the prepared statement. If the prepared statement included parameter markers, you must pass an array of input values
    	* 
    	*  @param $params: the name of your database
    	*  @example $db->prepare("SELECT column FROM table")->execute(); 
    	*  @example $db->prepare("SELECT column FROM table WHERE column = ?")->execute(array('7'));
    	* 
    	**/
    	public function execute($params = array()){
    		$transaction = $this->_statements[$this->_query_count];
    		if(is_array($params) && count($params) > 0){
    			$transaction->execute($params);
    			$this->_columns_count = $transaction->columnCount();
    			$this->_affected_rows = $transaction->rowCount();
    		}else{
    			$transaction->execute();
    			$this->_columns_count = $transaction->columnCount();
    			$this->_affected_rows = $transaction->rowCount();
    		}
    	}
    
    
    /**
    *  Fetches a row from a result set associated with a PDOStatement object. 
    *  The fetch_style parameter determines how PDO returns the row.
    * 
    *  @param $fetch_mode: the desired fetch mode.
    *  @example $results = $db->fetch(DBO::FETCH_ASSOC); 
    *  @example $results = $db->fetch(DBO::FETCH_BOTH);
    *  @example $results = $db->fetch(DBO::FETCH_OBJ);
    *  @example $results = $db->fetch(DBO::FETCH_NUM);
    *  @example $results = $db->fetch(DBO::FETCH_CLASS);
    **/
    public function fetch($fetch_mode = self::FETCH_BOTH){
    	$transaction = $this->_statements[$this->_query_count];
    	$fetch_modes = array(
    		3 => PDO::FETCH_ASSOC,
    		4 => PDO::FETCH_BOTH ,
    		5 => PDO::FETCH_OBJ ,
    		6 => PDO::FETCH_NUM ,
    		7 => PDO::FETCH_CLASS
    	);
    
    	$results = $transaction->fetch($fetch_modes[$fetch_mode]);
    	$this->_results_count = count($results);
    	return $results;
    }
    
    
    
    /**
    *  Fetches all the rows 
    * 
    *  @param $params: the name of your database
    *  @example $db->prepare("SELECT column FROM table")->execute(); 
    *  @example $db->prepare("SELECT column FROM table WHERE column = ?")->execute(array('7'));
    * 
    **/
    public function fetchAll(){
    	$transaction = $this->_statements[$this->_query_count];
    	$results = $transaction->fetchAll();
    	$this->_results_count = count($results);
    	return $results;
    }
    
    
    
    
    public function fetchObject(){
    	$transaction = $this->_statements[$this->_query_count];
    	$results = $transaction->setFetchMode(PDO::FETCH_OBJECT);
    	return $results;
    }
    
    
    
    
    public function fetchClass($classname , array $args = array()){
    	$transaction = $this->_statements[$this->_query_count];
    
    	if(!is_array($args)){
    		if($this->_error_mode === 0){
    			return false;
    		}elseif($this->_error_mode === 1){
    			trigger_error('Argument Error: seems one or more of the supplied arguments is not a '
    				          .'string type only string types are expected by DB prepare.');
    		}else{
    			throw new DBO_Exception('Argument Error: seems one or more of the supplied arguments is not a '
    				                    .'string type only string types are expected by DB prepare. File:');
    		}
    	}elseif(count($args) > 0){
    		$results = $transaction->setFetchMode(PDO::FETCH_CLASS , (string)$classname , (array) $args);
    	}else{
    		$results = $transaction->setFetchMode(PDO::FETCH_CLASS , (string)$classname);
    	}
    
    	return $results;
    }
    
    
    
    
    public function getAvailableDrivers(){
    	return $this->_lid->getAvailableDrivers();
    }
    
    
    
    
    public function getNumColumns(){
    	return $this->_columns_count;
    }
    
    
    
    
    public function getNumResults(){
    	return $this->_results_count;
    }
    
    
    
    
    public function getAffectedRows(){
    	return $this->_affected_rows;
    }
    
    
    
    
    public function getLastError(){
    	return $this->_last_error;
    }
    
    
    
    
    public function getErrorMode(){
    	return $this->_error_mode;
    }
    
    
    
    
    public function queryCount(){
    	return $this->_query_count;
    }
    
    
    
    
    public function lastInsertedId(){
    	return $this->_lid->lastInsertId();
    }
    
    
    
    
    public function setAttributes(){
    	$args = func_get_args();
    	foreach($args as $arg){
    		 $this->setErrorMode($arg);
    	}
    
    	return;
    }
    
    
    
    
    public function setFetchMode(){
    
    	$fetch_modes = array(
    		3 => PDO::FETCH_ASSOC,
    		4 => PDO::FETCH_BOTH ,
    		5 => PDO::FETCH_OBJ ,
    		6 => PDO::FETCH_NUM ,
    		7 => PDO::FETCH_CLASS
    	);
    
    	$args          = func_get_args();
    	$fetch_mode    = $args[0];
    	$obj_col_class = @$args[1];
    	$constr        = @$args[2];
    
    	if(isset($fetch_mode)){
    		if(isset($obj_col_class) && !isset($constr)){
    			$transaction = $this->_statements[$this->_query_count];
    		    $transaction->setFetchMode($fetch_modes[$fetch_mode] , $obj_col_class);
    	    }elseif(isset($obj_col_class) && isset($constr)){
    			$transaction = $this->_statements[$this->_query_count];
    		    $transaction->setFetchMode($fetch_modes[$fetch_mode] , $obj_col_class , $constr);
    		}else{
    			$transaction = $this->_statements[$this->_query_count];
    		    $transaction->setFetchMode($fetch_modes[$fetch_mode]);
    		}
    	}
    
    }
    
    
    
    
    public function setErrorMode($error_mode){
    	if(is_int($error_mode)){
    		if($error_mode === 0 || $error_mode === 1 || $error_mode === 2){
    			return $this->_error_mode = (int)$error_mode;
    		}
    	}
    
    	return false;
    }
    }
    
    class DBO_Exception extends Exception{
    
    }

      You could attach the whole thing as a text file...

        Write a Reply...