<?php
/*
-------------------------------------------------------------------------
dbCnx Class
An abstract class to be used as a parent class for sqlite, mysql, etc... to handle DB connectivity
-------------------------------------------------------------------------
Developer
Name -- Haddad Said.
Date -- 10-08-2005
Version -- 1.2
-------------------------------------------------------------------------
Member Functions
1.Constructor -- Obvious!
2.getError -- Returns the query error as reported by mysqlserver.
-------------------------------------------------------------------------
*/
require_once("class.db.result.php");
class dbCnx
{
//Variable to hold the connection resource
var $db_cnx;
//Variable to hold the result resource
var $db_result;
//Variable to hold the error string as reported by the DB server
var $db_error;
/*
-------------------------------------------------------------------------
Class Constructor
Parameters:
Notes:
Abstract method...leave empty...
Example Usage:
-------------------------------------------------------------------------
*/
function dbCnx()
{
}
/*
-------------------------------------------------------------------------
Method getError
A method to send the error as reported by the mysql server
Parameters:
Notes:
This method outputs the error string stored in $this->db_error.
This member variable is overwritten each time another db error
occurs, so this method must be called as soon as an error has occured
Example Usage:
if($db = new dbMysql("localhost", "user", "pass", "db_name"))
{
//Execute some code on succesful connection here.
}
else
{
//Send the error encountered.
echo $db->getError();
}
-------------------------------------------------------------------------
*/
function getError()
{
return $this->db_error;
}
}
?>