1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| class PdoVersement {
private static $serveur='mysql:host=localhost:/tmp/mysql5.sock';
private static $bdd='dbname=dbxxxxxxxxx';
private static $user='dboxxxxxxxxx' ;
private static $mdp='xxxxxxxxx';
private static $monPdo;
private static $monPdoVersement=null;
private function __construct(){
try{
PdoVersement::$monPdo = new PDO(PdoVersement::$serveur.';'.PdoVersement::$bdd, PdoVersement::$user, PdoVersement::$mdp);
PdoVersement::$monPdo->query("SET CHARACTER SET utf8");
}
catch(PDOException $e){
echo 'Connection failed: ' . $e->getMessage();
} |
Partager