class mysqldb{
private $dbname = "";
private $dbuser = "";
private $dbhost = "";
private $dbpass = "";
private $link;
public function __construct($name, $user = "user", $host = "localhost", $pass = "pass"){
$this->dbname = $name;
$this->dbuser = $user;
$this->dbhost = $host;
$this->dbpass = $pass;
$this->connect();
}
private function connect(){
$this->link = mysql_connect($this->dbhost,$this->dbuser,$this->dbpass);
$this->select_db($this->dbname);
}
private function select_db($db_nr){
$this->select = mysql_select_db($this->dbname);
}
puplic function close(){
if(is_resource($this->link)){
mysql_close($this->link);
}
}
}