Location: PHPKode > projects > XplainCart > xplaincart-1.0/library/database_class.php
<?php

define('dbHost',XOOPS_DB_HOST);
define('dbUser',XOOPS_DB_USER);
define('dbPass',XOOPS_DB_PASS);
define('dbName',XOOPS_DB_NAME);

class database_class{
	//var $sqlresult;
	//var $result;
	var $dbConn;
	function database_class(){
		$this->dbConn = mysql_connect (dbHost,dbUser,dbPass) or die ('MySQL connect failed. ' . mysql_error());
		mysql_select_db(dbName,$this->dbConn) or die('Cannot select database. ' . mysql_error());
	}
	function dbQuery($sql)
	{
		//$this->sqlresult = mysql_query($sql) or die(mysql_error());	
		return mysql_query($sql);
	}
	function dbAffectedRows()
	{	
		//$this->result=mysql_affected_rows($this->dbConn);
		return mysql_affected_rows($this->dbConn);
	}
	function dbFetchArray($result) {
		//$this->result=mysql_fetch_array($this->sqlresult,MYSQL_NUM);
		return mysql_fetch_array($result,MYSQL_NUM);
	}
	function dbFetchAssoc($result)
	{
		//$this->result=mysql_fetch_assoc($this->sqlresult);
		return mysql_fetch_assoc($result);
	}
	function dbFetchRow($result) 
	{
		//$this->result=mysql_fetch_row($this->sqlresult);
		return mysql_fetch_row($result);
	}
	function dbFreeResult($result)
	{
		mysql_free_result($result);
		//mysql_free_result($this->sqlresult);
	}
	function dbNumRows($result)
	{
		//$this->result=mysql_num_rows($this->sqlresult);
		return mysql_num_rows($result);
	}
	function dbSelect()
	{
		return mysql_select_db(dbName);
	}
	function dbInsertId()
	{
		$this->result=mysql_insert_id();
		return $this->result;
	}
}
?>
Return current item: XplainCart