Location: PHPKode > scripts > CBenchmark > cbenchmark/example.classes.php
<?php
class DBProvider{
	var $db;
	var $res;

	function Open(){

	}
	function Query($sSql){

	}
	function GetRow(){

	}
}
class MySQL extends DBProvider {
	function Open($host,$user,$pass,$db){
		$this->db=mysql_connect($host,$user,$pass);
		mysql_select_db($db,$this->db);
	}

	function Query($sSql){
		$this->res=mysql_query($sSql,$this->db);
	}

	function getRow(){
		return mysql_fetch_row($this->res);
	}

}
class SQLite extends DBProvider {
	function Open($db){
		$this->db=sqlite_open($db);
	}

	function Query($sSql){
		$this->res=sqlite_query($this->db,$sSql);
	}

	function getRow(){
		return sqlite_fetch_array($this->res,SQLITE_NUM);
	}
}
?>
Return current item: CBenchmark