Beispiel #1
0
 public function __construct()
 {
     Attributes::$database_connect = mysql_connect(self::DATABASE_HOST, self::DATABASE_USER, self::DATABASE_PASSWORD);
     if (!Attributes::$database_connect) {
         echo "Unable to connect to DB: " . mysql_error(Attributes::$database_connect);
         exit;
     }
     mysql_query("SET NAMES 'UTF8'", Attributes::$database_connect);
     if (!mysql_select_db(self::DATABASE_NAME, Attributes::$database_connect)) {
         echo "Unable to select mydbname: " . mysql_error(Attributes::$database_connect);
         exit;
     }
     $this->parser = xml_parser_create();
     xml_set_object($this->parser, $this);
     xml_set_element_handler($this->parser, "tag_open", "tag_close");
     xml_set_character_data_handler($this->parser, "cdata");
 }