Hi Guys,
I'll keep this short and sweet:
[PHP]
class connection{
public $database;
public $username;
public $password;
public $ident;
public function __construct(){
$this->database="tm c-tectest";
$this->username="root ";
$this->password="cr1m 50n";
$this->ident=mysql_co nnect($this->$database,$thi s->$username,$thi s->$password);
}
}
[/PHP]
what is wrong with that?
error is Fatal error: Cannot access empty property in /www/wwwroot/tools/projects/functions.php on line 13
EDIT: Sorry, Solved it, I was being an idiot. I should have used $this->var instead of $this->$var
I'll keep this short and sweet:
[PHP]
class connection{
public $database;
public $username;
public $password;
public $ident;
public function __construct(){
$this->database="tm c-tectest";
$this->username="root ";
$this->password="cr1m 50n";
$this->ident=mysql_co nnect($this->$database,$thi s->$username,$thi s->$password);
}
}
[/PHP]
what is wrong with that?
error is Fatal error: Cannot access empty property in /www/wwwroot/tools/projects/functions.php on line 13
EDIT: Sorry, Solved it, I was being an idiot. I should have used $this->var instead of $this->$var
Comment