<php
/**
* Simple Class Connect
*/
class Connect {
var $host="localhost";
var $dbname="yourdatabase";
var $usuario="userserver";
var $password="passwordserver";
var $link;
var $unlink;
function onServer()
{
$this->link = mysql_connect($this->host, $this->usuario, $this->password);
$this->database = mysql_select_db($this->dbname);
}
function offServer()
{
$this->unlink = mysql_close($this->link);
}
}
$var = new Connect();
$var->onServer();
echo 'run your queries here';
$var->offServer();
?>