Ini_Key = "[".strtolower($IniKey)."]"; $this->Ini_Variable = strtolower($IniVar); $this->Ini_File = file($IniFile); unset($this->Ini_Value); for($Ini_Rec=0; $Ini_RecIni_File); $Ini_Rec++) { $this->Ini_Temp = trim($this->Ini_File[$Ini_Rec]); $this->Ini_Tmp = strtolower($this->Ini_Temp); if ( substr_count($this->Ini_Tmp, "[") > 0 ) $this->Ini_Ready = 0; if ( $this->Ini_Tmp == $this->Ini_Key ) $this->Ini_Ready = 1; If ( (substr_count($this->Ini_Tmp, "[") == 0) && ($this->Ini_Ready == 1) ) { if (substr_count($this->Ini_Tmp, $this->Ini_Variable . " =") > 0) { $this->Ini_Value = substr($this->Ini_Temp, strlen($this->Ini_Variable . " =")+1); return $this->Ini_Value; } } } if ( !$this->Ini_Value ) { return "ERROR .: Key: [".strtoupper($IniKey)."] or Variable: ".strtoupper($IniVar).", does not exist in ".strtoupper($IniFile)." file !"; // Key or Variable NOT FOUND in INI file } } } ?>connection = @mysql_connect($host, $user, $password) or die ($this->error()); } function select_db($database) { @mysql_select_db($database, $this->connection) or die ($this->error()); } function close() { @mysql_close($this->connection) or die ($this->error()); } function query($_query, $benchmark = 0) { $starttime = explode(" ",microtime()); $this->id_query = @mysql_query($_query,$this->connection) or die ($this->error($_query)); $endtime = explode(" ",microtime()); $this->queries++; if ($benchmark == 1 && substr(trim(strtoupper($_query)),0,6) == "SELECT") { $queryid = mysql_query("EXPLAIN ".$_query."",$this->connection); echo "\n"; while($array = mysql_fetch_array($queryid)) { echo "\n"; } echo ""; echo "
tabletypepossible_keyskeykey_lenrefrowsExtra
$array[table] $array[type] $array[possible_keys] $array[key] $array[key_len] $array[ref] $array[rows] $array[Extra] 
".(($endtime[0]+$endtime[1])-($starttime[0]+$starttime[1]))."
\n"; } return $this->id_query; } function query_first($_query, $explain = 0) { $this->queries++; $this->id_query = $this->query($_query, $explain); $data = $this->fetch_array($this->id_query); $this->free_result($this->id_query); return $data; } function query_all($_query, $benchmark = 0) { $query = $this->query($_query, $benchmark); while($row = $this->fetch_array($query)) { $data[] = $row; } $this->free_result($query); return $data; } function affected_rows() { return @mysql_affected_rows(); } function fetch_array($id_query = 0) { if($id_query == 0) { $id_query = $this->id_query; } return @mysql_fetch_array($id_query); } function insert_id() { return @mysql_insert_id(); } function num_rows($id_query = 0) { if($id_query == 0) { $id_query = $this->id_query; } return @mysql_num_rows($id_query); } function list_tables($id_query = 0) { if($id_query == 0) { $id_query = $this->id_query; } return @mysql_list_tables($id_query); } function num_fields($id_query = 0) { if($id_query == 0) { $id_query = $this->id_query; } return @mysql_num_fields($id_query); } function field_name($id_query = 0) { if($id_query == 0) { $id_query = $this->id_query; } return @mysql_field_name($id_query); } function free_result($id_query = 0) { if($id_query == 0) { $id_query = $this->id_query; } return @mysql_free_result($id_query); } function error($_query = "") { echo "

Datenbankfehler

"; //mail(HOMEPAGE_WEBMASTER, "Datenbankfehler: ".HOMEPAGE_URL."", mysql_error()."\n\n".$_query, "From:system@ngl-europe.com"); echo "

".mysql_error()."

".$_query."

"; exit; } } ?>