I use a file ( ss-config.php) that contains information about connecting a servo motor and a database, here is the file code ss-config.php:
<?php
define('DB_NAME', 'ssiphone');
define('DB_USER', 'root');
define('DB_PASSWORD', '');
define('DB_HOST', 'localhost');
?>
but when I try to connect, I got this error:
Parse error: parse error in C:\wamp\www\ssiphone\classes\ConnectionManipulationBaseDeDonnees.php on line 21
this is my code that would suggest causing the problem:
class ConnectionManipulationBaseDeDonnees
{
private $bdd;
public function connection(){
include("../ssiphoneadmin/ss-config.php");
$host=DB_HOST;
$dbname=DB_NAME;
$dbuser=DB_USER;
$dbpsw=DB_PASSWORD;
try{
$pdo_options[PDO::ATTR_ERRMODE]=PDO::ERRMODE_EXCEPTION;
$this->bdd=new PDO('mysql:host='.$host.';dbname='.$dbname.','.$dbuser.','.$dbpsw.','$pdo_options);
}
catch(Exception $e)
{
die('Erreur: '.$e->getMessage());
}
}
}
line 21 is the line containing the statement $this. thanks for any help :)
source
share