Query($sql);
$dbtimethishit += getmicrotime();
return $r;
}
function db_insert_id() {
global $mysql_object;
$dbtimethishit -= getmicrotime();
$r = $mysql_object->insert_id;
$dbtimethishit += getmicrotime();
return $r;
}
function db_error() {
global $mysql_object;
//$errno = $mysql_object->Errno;
//$error = $mysql_object->Error;
$errno = mysqli_errno($mysql_object);
$error = mysqli_error($mysql_object);
$r = "Datenbankfehler!
Fehler Nummer #".$errno.", Meldung:
".$error;
return $r;
}
function db_fetch_assoc($result){
global $dbtimethishit;
$dbtimethishit -= getmicrotime();
$r = $result->Fetch_Assoc();
$dbtimethishit += getmicrotime();
return $r;
}
function db_num_rows($result){
global $dbtimethishit;
$dbtimethishit -= getmicrotime();
$r = $result->num_rows;
$dbtimethishit += getmicrotime();
return $r;
}
function db_affected_rows($link=false){
global $dbtimethishit,$mysql_object;
$dbtimethishit -= getmicrotime();
$r = $mysql_object->affected_rows;
$dbtimethishit += getmicrotime();
return $r;
}
function db_connect($host,$user,$pass,$database){
global $dbtimethishit,$mysql_object;
$dbtimethishit -= getmicrotime();
$mysql_object = new MySQLi($host,$user,$pass,$database);
$dbtimethishit += getmicrotime();
}
function db_free_result($result){
global $dbtimethishit;
$dbtimethishit -= getmicrotime();
$r = $result->Free();
$dbtimethishit += getmicrotime();
return $r;
}
/*
function db_query($sql){
global $session,$dbqueriesthishit,$dbtimethishit;
$dbqueriesthishit++;
$dbtimethishit -= getmicrotime();
$fname = DBTYPE."_query";
$r = $fname($sql) or die(($session[user][superuser]>=3 || 1?"
".HTMLEntities($sql)."":"").db_error(LINK)); $dbtimethishit += getmicrotime(); //$x = strpos($sql,"WHERE"); //if ($x!==false) { // $where = substr($sql,$x+6); // $x = strpos($where,"ORDER BY"); // if ($x!==false) $where = substr($where,0,$x); // $x = strpos($where,"LIMIT"); // if ($x!==false) $where = substr($where,0,$x); // $where = preg_replace("/'[^']*'/","",$where); // $where = preg_replace('/"[^"]*"/',"",$where); // $where = preg_replace("/[^a-zA-Z ]/","",$where); // mysql_query("INSERT DELAYED INTO queryanalysis VALUES (0,\"".addslashes($where)."\",0)"); //} return $r; } function db_insert_id($link=false) { global $dbtimethishit; $dbtimethishit -= getmicrotime(); $fname = DBTYPE."_insert_id"; if ($link===false) { $r = $fname(); }else{ $r = $fname($link); } $dbtimethishit += getmicrotime(); return $r; } function db_error($link){ $fname = DBTYPE."_error"; $r = $fname($link); return $r; } function db_fetch_assoc($result){ global $dbtimethishit; $dbtimethishit -= getmicrotime(); $fname = DBTYPE."_fetch_assoc"; $r = $fname($result); $dbtimethishit += getmicrotime(); return $r; } function db_num_rows($result){ global $dbtimethishit; $dbtimethishit -= getmicrotime(); $fname = DBTYPE."_num_rows"; $r = $fname($result); $dbtimethishit += getmicrotime(); return $r; } function db_affected_rows($link=false){ global $dbtimethishit; $dbtimethishit -= getmicrotime(); $fname = DBTYPE."_affected_rows"; if ($link===false) { $r = $fname(); }else{ $r = $fname($link); } $dbtimethishit += getmicrotime(); return $r; } function db_pconnect($host,$user,$pass){ global $dbtimethishit; $dbtimethishit -= getmicrotime(); $fname = DBTYPE."_connect"; $r = $fname($host,$user,$pass); $dbtimethishit += getmicrotime(); return $r; } function db_select_db($dbname){ global $dbtimethishit; $dbtimethishit -= getmicrotime(); $fname = DBTYPE."_select_db"; $r = $fname($dbname); $dbtimethishit += getmicrotime(); return $r; } function db_free_result($result){ global $dbtimethishit; $dbtimethishit -= getmicrotime(); $fname = DBTYPE."_free_result"; $r = $fname($result); $dbtimethishit += getmicrotime(); return $r; }*/ ?>