init
This commit is contained in:
commit
72a26edcff
22092 changed files with 2101903 additions and 0 deletions
64
lib/maria.class.php
Normal file
64
lib/maria.class.php
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
<?php
|
||||
$out=[];
|
||||
|
||||
class mysql extends mysqli{
|
||||
private $querys = 0;
|
||||
|
||||
function insert($sql){
|
||||
$this->query($sql);
|
||||
return $this->insert_id;
|
||||
}
|
||||
|
||||
|
||||
function query($sql){
|
||||
$return = parent::query($sql);
|
||||
if(!$return){
|
||||
trigger_error("Message: ".$this->error." (".$sql.")", E_USER_ERROR);
|
||||
}else{
|
||||
$this->querys++;
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function query_single($sql){
|
||||
$out = $this->query($sql);
|
||||
$return = $out->fetch_assoc();
|
||||
$return['num_rows'] = $out->num_rows;
|
||||
return $return;
|
||||
}
|
||||
|
||||
function query_id($sql){
|
||||
$out=[];
|
||||
$out_db = $this->query($sql);
|
||||
while($tmp = $out_db->fetch_assoc()){
|
||||
$out[$tmp['id']] = $tmp;
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
function query_array($sql){
|
||||
$out=[];
|
||||
$out_db = $this->query($sql);
|
||||
while($tmp = $out_db->fetch_assoc()){
|
||||
$out[] = $tmp;
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
function clean($sql){
|
||||
$sql = stripslashes($sql);
|
||||
$sql = $this->real_escape_string($sql);
|
||||
return $sql;
|
||||
}
|
||||
|
||||
function anzahl_querys(){
|
||||
return $this->querys;
|
||||
}
|
||||
|
||||
function get_last_id(){
|
||||
return $this->insert_id;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue