class KnivesModel {
private $db;
public function __construct($dsn, $user, $pass){
try{
$this->$db = new PDO($dsn, $user, $pass);
}catch(PDOException $e){
var_dump($e);
};
}; // __construct
}
This code breaks my app. I’m not even instantiating this class yet. All I do is include this class in my index.php and the “app” blows up with 500 error. What’s the problem?
There should be no
;at the end of thetry catchand the__constructfunction.