\n"; $msg .= "vorübergehend nicht aufgerufen werden.\n"; break; case "no_connect": $msg = "Die Datenbank ist momentan nicht erreichbar.
\n"; $msg .= "Versuchen Sie es bitte später noch einmal.\n"; break; case "sql_error": $msg = "Es ist ein Datenbank-Fehler aufgetreten
\n"; $msg .= "Versuchen Sie es bitte später noch einmal.\n"; break; case "no_admin": $msg = "Sie haben keine administrativen Rechte und
\n"; $msg .= "können deshalb nicht auf diese Seite zugreifen.\n"; break; case "no_right": $msg = "Sie haben keine Berechtigung, auf diese Seite zuzugreifen!\n"; break; case "login_error": $msg = "Ihre Zugangsdaten sind falsch.\n"; $msg .= "Bitte loggen Sie sich erneut ein!"; break; case "active_session": $msg = "Im Moment ist kein Zugriff auf die Moderator-Daten möglich,\n"; $msg .= "da sie gerade von einem anderen User bearbeitet werden."; break; case "no_session": $msg = "Sie sind nicht richtig eingeloggt oder haben Cookies\n"; $msg .= "in Ihrem Browser deaktiviert."; break; case "invalid_session": $msg = "Sie müssen sich neu einloggen, da die aktuellen\n"; $msg .= "Sitzungsdaten nicht mehr gültig sind."; break; default: $msg = $errMsg; } ?>


Fehler

 

 
zurück
host='localhost'; $this->user='usr_dmt_webseite'; $this->pass='!M4/SFvGxZ?RXs'; $this->data='db_dmt49_webseite'; $this->error_action = $action; $this->error_string = $string; $this->cnt = 0; /* $this->host='db400444767.db.1and1.com'; $this->user='dbo400444767'; $this->pass='bi6Gdhz9N'; $this->data='db400444767'; $this->error_action = $action; $this->error_string = $string; $this->cnt = 0; */ } function connect() { $this->cnt++; $this->linkID = mysql_connect($this->host,$this->user,$this->pass); if (!$this->linkID) { $this->check_error("no connection"); return false; } else { $ok = mysql_select_db($this->data); if (!$ok) { $this->check_error("could not use database" . $this->data); return false; } else { return true; } } } // private function check_error($sql) { global $SCRIPT_NAME, $dat, $adminemail, $robotemail; $this->error_mysql = mysql_error(); $body = "script: " . $SCRIPT_NAME . "\n"; $body .= "number of MySQL function calls: " . $this->cnt . "\n"; $body .= "SQL statement: " . $sql . "\n"; $body .= "MySQL error message: " . $this->error_mysql . "\n"; $body .= "user_id: " . $dat."\n"; $subj = ($sql == "no connection") ? $sql : $SCRIPT_NAME ; if ($this->error_action == "mail") { mail($adminemail,"MySQL Fehler in GENERATOR Datenbank - " . $this->error_string . " - " . $subj,$body,"From: ".$robotemail); } if ($this->error_action == "echo") {?> \n",$body); } $msg = ($this->cnt > 1) ? "sql_error" : "no_connect" ; handle_error($msg); } //private function select($table,$fields="*",$where="",$group="",$order="",$limit="",$fileName="",$having="",$on="") { $this->cnt++; $sql = "SELECT $fields"; if ($fileName) { $sql .= " INTO OUTFILE '" . $fileName . "'"; } $sql .= " FROM $table"; if ($on) { $sql .= " ON " . $on; } if ($where) { $sql .= " WHERE " . $where; } if ($group) { $sql .= " GROUP BY " . $group; } if ($having) { $sql .= " HAVING " . $having; } if ($order) { $sql .= " ORDER BY " . $order; } if ($limit) { $sql .= " LIMIT " . $limit; } $this->result = mysql_query($sql) ; if (!$this->result) { $this->check_error($sql); return false; } else { return true; } } function search($table,$searchFields,$searchString,$fields="*",$group="",$order="",$limit="") { $searchString = addslashes(htmlspecialchars($searchString)); $searchString = ereg_replace("%","\%",$searchString); $searchString = ereg_replace("_","\_",$searchString); $cnt = 0; $where = ""; while (list(,$val) = each($searchFields)) { if ($cnt>0) { $where .= " OR "; } $where .= $val . " LIKE '%$searchString%'"; $cnt++; } $table = $this->getAllRows($table,$fields,$where,$group,$order,$limit); return $table; } function insert($table,$values,$columns="") { $this->cnt++; $sql = "INSERT INTO $table"; if ($columns) { $sql .= " (" . $columns . ")" ; } $sql .= " VALUES (" . $values . ")"; return $this->query($sql); } function replace($table,$values,$columns="") { $this->cnt++; $sql = "REPLACE INTO $table"; if ($columns) { $sql .= " (" . $columns . ")" ; } $sql .= " VALUES (" . $values . ")"; return $this->query($sql); } function transfer($mode,$table,$columns,$sel_table,$sel_columns="*",$sel_where="") { $this->cnt++; $sql = "$mode INTO $table"; if ($columns) { $sql .= " (" . $columns . ")" ; } $sql .= " SELECT $sel_columns FROM $sel_table"; if ($sel_where) { $sql .= " WHERE " . $sel_where; } return $this->query($sql); } // private: function update($table,$set,$where="") { $this->cnt++; $sql = "UPDATE $table SET $set"; if ($where) { $sql .= " WHERE " . $where; } return $this->query($sql); } function delete($table,$where="") { $this->cnt++; $sql = "DELETE FROM $table"; if ($where) { $sql .= " WHERE " . $where; } return $this->query($sql); } // private function query($sql) { $q = mysql_query($sql) ; if (!$q) { $this->check_error($sql); return false; } else { return mysql_affected_rows($this->linkID); } } function ddl_query($sql) { $this->cnt++; $q = mysql_query($sql) ; if (!$q) { $this->check_error($sql); return false; } else { return true; } } function setField($table,$fieldName,$value,$where="") { $set = $fieldName . "=" . $value; $ok = $this->update($table,$set,$where); return $ok; } function setFields($table,$fieldNames,$values,$where="") { $set=""; for ($i=0; $i < count($fieldNames); $i++) { if ($i>0) { $set .= ","; } //$val = $this->prepareStrings($values[$i]); $set .= $fieldNames[$i] . "=" . $values[$i]; } $ok = $this->update($table,$set,$where); return $ok; } function getField($table,$fieldName,$where) { $row = $this->getRow($table,$fieldName,$where); return $row[$fieldName]; } // private function prepareStrings($var) { if (is_string($var)) { $var = ereg_replace("\r\n","
",$var); $var = ereg_replace("\n","
",$var); $var = ereg_replace("\r","
",$var); return $var; } else { return $var; } } function getRow($table,$fields="*",$where="") { $this->select($table,$fields,$where); $row = mysql_fetch_array($this->result, MYSQL_ASSOC); return $row; } function getAllRows($table,$fields="*",$where="",$group="",$order="",$limit="",$fileName="",$having="",$on="") { $this->select($table,$fields,$where,$group,$order,$limit,$fileName,$having,$on); if (!$fileName) { while ($row = mysql_fetch_array($this->result, MYSQL_ASSOC)) { $tbl[] = $row; } return $tbl; } else { return $this->result; } } function getAllFieldNames($tbl) { $this->result = mysql_list_fields($this->data,$tbl) ; if (!$this->result) { $this->check_error($sql); return false; } else { for ($i = 0; $i < mysql_num_fields($this->result); $i++) { $table[] = mysql_field_name($this->result,$i); } return $table; } } } ?>