private static function initialize() { if (self::$initialized) { return; } self::$dbhostname = 'localhost'; self::$dbusername = '******'; self::$dbpassword = '******'; self::$dbdatabase = 'hellgami_website'; self::$initialized = true; }
private static function initialize() { if (self::$initialized) { return; } self::$dbhostname = '127.0.0.1'; self::$dbusername = '******'; self::$dbpassword = '******'; self::$dbdatabase = 'u117963703_est'; self::$initialized = true; }
private function __construct() { Database_Config::transmit(); try { $this->_connection = new PDO("mysql:host=" . Database_Config::$dbhostname . ";dbname=" . Database_Config::$dbdatabase, Database_Config::$dbusername, Database_Config::$dbpassword, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")); $this->_connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch (Exception $e) { die($e->getMessage()); } catch (Exception $e) { throw new Exception('Nu s-a putut realiza conexiunea la baza de date!'); } }