i want to know if there is a way that always i have one opened connection into my database. i'm using this codes in my sites :
mysql class
class Mysql{
public static $Server   = "localhost";
static $User = 'root';
static $Password = '';
static $DataBaseName = 'teca.v1';
static $Connection;
static $DataBase;
static $LoadConnection = 0;
static $CharSet = "utf8";
static $TRANS =false;
static $TRSS  = array();
public function __construct(){
    if(Mysql::$LoadConnection==0){
        Mysql::$Connection = mysql_connect(Mysql::$Server,Mysql::$User,Mysql::$Password);
        Mysql::$DataBase   = mysql_select_db(Mysql::$DataBaseName,Mysql::$Connection);
        $charset=Mysql::$CharSet;
        mysql_query("SET NAMES $charset");
        Mysql::$LoadConnection=1;
    }
}
}
model class
class Model extends Mysql{
protected $datamembers = array();
protected $PrimaryKey="Id";
protected $TableName ="Table";
public $UnProtectedExecute = FALSE;
public  function ReadyString($value)
{
    if($this->UnProtectedExecute == TRUE)
        return addslashes($value);
    else
        return $value;
}
public function __set($variable, $value){
    $this->datamembers[strtolower($variable)] = $value;
}
public function __get($variable){
    return $this->datamembers[strtolower($variable)];
}
and one of my objects :
class LibraryFiles extends Model{
    public $TableName   = 'library_files';
}
but i dont know is this right and just this code create 1 connection for all of the object in my project?
 
     
     
     
    