I am writing a DAO class to connect to SQL Server database. I have this error that I don't know how to fix it. My code :
class DAO
{
// @var PDO : Attribut représentant la base de données
private $db;
// Connexion à la BDD
function __construct()
{
try {
$dsn = '192.168.102.232\SQLEXPRESS'
$this->db = new PDO("sqlsrv:Server=192.168.102.232\SQLEXPRESS;Database=PROFACE", "username", "pwd");
$this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
exit("Cannot open DB : ".utf8_encode($e->getMessage()));
}
}
}
}
And the error : Parse error: syntax error, unexpected '$this' (T_VARIABLE) in C:\wamp\www\WebJM\AffichageHistorique\db\database.php