Exemple #1
0
 public function __construct()
 {
     Lists::$database_connect = mysql_connect(self::DATABASE_HOST, self::DATABASE_USER, self::DATABASE_PASSWORD);
     if (!Lists::$database_connect) {
         echo "Unable to connect to DB: " . mysql_error(Lists::$database_connect);
         exit;
     }
     mysql_query("SET NAMES 'UTF8'", Lists::$database_connect);
     if (!mysql_select_db(self::DATABASE_NAME, Lists::$database_connect)) {
         echo "Unable to select mydbname: " . mysql_error(Lists::$database_connect);
         exit;
     }
 }