/** * * @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; } }
public function __construct() { $this->SQL = PDO_Mysql::getInstance(); $this->_login = $this->_password = ''; $this->_name = $this->_firstname = $this->_email = ''; }
public function __construct() { $this->SQL = PDO_Mysql::getInstance(); }
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\'')); }