Mam swoją klasę i konstruktor ale niestety nie spełnia swjej funkcjonalnośći jak powinien. Powinien inicjować połączenie z bazą, w każdej metodze muszę wprowadzać te linijki kodu. Co robię źle w ciele konstruktora?

class MySQL_class
{
function __construct()
{
require_once("globals.php");
$this->server = DB_SERVER;
$this->username = DB_USER;
$this->password = DB_PASS;
$this->db_name = DB_NAME;
$this->db_connection = mysql_connect($this->server, $this->username, $this->password) or
die("Connection failed. Error: " . mysql_error()); }
function Login()
{
require_once("globals.php");
$this->server = DB_SERVER;
$this->username = DB_USER;
$this->password = DB_PASS;
$this->db_name = DB_NAME;
$this->db_connection = mysql_connect($this->server, $this->username, $this->password) or
die("Connection failed. Error: " . mysql_error());
$haslo_crypt=crypt($this->passwd,'bab'); $querry = "SELECT nickname, password FROM gracz WHERE nick='$this->nick' AND passwd='$haslo_crypt'";
{
$this->Set_role($this->row['role']);
$this->Set_nick($this->row['nick']);
$this->Set_password($this->row['passwd']);
$this->counter++;
return true;
}
}
}