Beispiel #1
0
 /**
  * 
  * @return PDOObject Initialize a PDO object
  */
 public function connect()
 {
     if (!is_null($this->statement)) {
         return $this->statement;
     }
     return $this->statement = PDO_Mysql::getInstance();
 }
 public static function init()
 {
     try {
         self::$_instancePDO = new PDO('mysql:host=' . DB_HOST . ';dbname=' . DB_NAME, DB_USER, DB_PASSWORD, array(PDO::ATTR_PERSISTENT => true, PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\''));
         self::$_instancePDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
     } catch (PDOException $e) {
         print $e->getMessage();
         exit;
     }
 }
Beispiel #3
0
 public function __construct()
 {
     $this->SQL = PDO_Mysql::getInstance();
     $this->_login = $this->_password = '';
     $this->_name = $this->_firstname = $this->_email = '';
 }
Beispiel #4
0
 public function __construct()
 {
     $this->SQL = PDO_Mysql::getInstance();
 }
Beispiel #5
0
 public static function init()
 {
     self::$_instancePDO = new PDO('mysql:host=' . DB_HOST . ';port=' . DB_PORT . ';dbname=' . DB_NAME, DB_USER, DB_PASSWORD, array(PDO::ATTR_PERSISTENT => true, PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\''));
 }