468,457 Members | 1,779 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,457 developers. It's quick & easy.

PHP Fatal error: Cannot access empty property

Tarantulus
114 100+
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="tmc-tectest";
$this->username="root";
$this->password="cr1m50n";
$this->ident=mysql_connect($this->$database,$this->$username,$this->$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
Jun 20 '08 #1
1 7180
pbmods
5,821 Expert 4TB
Heya, Tarantulus.

Glad to hear you got it sorted out. Good luck with your project!
Jun 27 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

8 posts views Thread by Tim Tyler | last post: by
6 posts views Thread by Peter Frost | last post: by
12 posts views Thread by TristaSD | last post: by
1 post views Thread by Simon Kittle | last post: by
1 post views Thread by subhajit12345 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.