[#] hm X_Shell Backd00r [#]
<?php
class Conexion{
private static $instancia;
private $conex;
private function __construct(){
try{
$this->conex = new PDO('mysql:host=localhost;dbname=c35autodromomabed','c35automabed','Bich@soft1');
#$this->conex = new PDO('mysql:host=localhost;dbname=automabed','root','');
$this->conex->exec("SET CHARACTER SET utf8");
$this->conex->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}catch(PDOExeption $e){
print "Error!:".$e->getMessage();
die();
}
}
public function prepare($sql){
return $this->conex->prepare($sql);
}
public static function singleton_conexion(){
if(!isset(self::$instancia)){
$miCalse = __CLASS__;
self::$instancia = new $miCalse;
}
return self::$instancia;
}
public function __clone(){
trigger_error('La clonación de este objeto no está permitida', E_USER_ERROR);
}
}
?>
Mr.hm X_Shell Backd00r 1.0, Coded By Mr.hm X_Shell Backd00r