Hey guys i have recently moved over to PDO and OOP and having some problems with the connection statement. The errors i am receiving are;
Notice: Undefined variable: db_host in C:\Users\PC\Documents\XAMPP\htdocs\libs\class.Manage.php on line 14
Fatal error: Cannot access empty property in C:\Users\PC\Documents\XAMPP\htdocs\libs\class.Manage.php on line 14
class ManageHits{
protected $link;
protected $db_host = "localhost";
protected $db_name = "ajaxrating";
protected $db_user = "userone";
protected $db_pass = "passwordone";
function __construct(){
try{
$this->link = new PDO($this->$db_host,$this->$db_name,$this->$db_user,$this->$db_pass);
return $this->link;
}
catch(PDOException $e){
return $e->getMessage;
}
}