@ 2014-04-14T05:28:09Z <?php
//by kuiGG www.kuigg.com
class kuigg_Db {
function tbname($tb)
{
return $tb;
}
function getdata ($arr , $separator = ‘,’) {
$str = $s = ”;
foreach ($arr as $k => $v) {
$str .= $s.”`{$k}`=’{$v}’”;
$s = $separator;
}
return $str;
}
function count ($tb , $fields = ‘*’ , $terms = ”){
$o = & self::in();
$tb= self::tbname($tb);
$where = empty($terms) ? ’1′ : $terms;
$query = “select count({$fields}) from `{$tb}` where {$where}”;
return $o->getVar($query);
}
function fetchdata ($tb , $fields = ‘*’ , $terms = ”){
$o = & self::in();
$tb= self::tbname($tb);
$data = array();
$query = “select {$fields} from `{$tb}` {$terms}”;
return $o->getData($query);
}
function fetchrow ($tb , $fields = ‘*’ , $terms = ”){
$o = & self::in();
$tb= self::tbname($tb);
$data = array();
$query = “select {$fields} from `{$tb}` {$terms}”;
return $o->getLine($query);
}
function fetchitem ($tb , $field , $terms = ”){
$o = & self::in();
$tb= self::tbname($tb);
$data = array();
$query = “select {$field} from `{$tb}` {$terms}”;
return $o->getVar($query);
}
function insert($tb, $arr, $getinsertid = false, $replace = false) {
$o = & self::in();
$tb= self::tbname($tb);
$data = self::getdata($arr);
$cmd = $replace ? ‘REPLACE INTO’ : ‘INSERT INTO’;
$silence = $silence ? ‘SILENT’ : ”;
$query = “{$cmd} `{$tb}` SET {$data}”;
$return = $o->runSql($query);
return $getinsertid ? $o->lastId() : $return;
}
function insert_id() {
$o = & self::in();
return $o->lastId();
}
function update($tb, $arr, $terms = NULL , $getarows = false , $low_priority = false) {
$o = & self::in();
$tb= self::tbname($tb);
$data = self::getdata($arr);
$cmd = “UPDATE “.($low_priority ? ‘LOW_PRIORITY’ : ”);
$where = empty($terms) ? ’1′ : $terms;
$query = “{$cmd} `{$tb}` SET {$data} WHERE {$where}”;
$return = $o->runSql($query);
return $getarows ? $o->affectedRows() : $return;
}
function delete($tb, $terms = NULL,$getarows = false, $limit = 0) {
$o = & self::in();
$tb = self::tbname($tb);
$where = empty($terms) ? ’1′ : $terms;
$query = “DELETE FROM `{$tb}` WHERE {$where} “.($limit ? “LIMIT {$limit}” : ”);
$return = $o->runSql($query);
return $getarows ? $o->affectedRows() : $return;
}
function affected_rows() {
$o = & self::in();
return $o->affectedRows();
}
function query($query) {
$o = & self::in();
return $o->runSql($query);
}
function &in() {
static $object;
if(empty($object)) {
$object = new SaeMysql();
}
return $object;
}
}
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Version System time (s) User time (s) Memory (MiB) 5.5.11 0.007 0.063 17.32 5.5.10 0.013 0.073 17.21 5.5.9 0.007 0.073 17.19 5.5.8 0.003 0.080 17.23 5.5.7 0.000 0.057 17.23 5.5.6 0.013 0.063 17.22 5.5.5 0.010 0.063 17.19 5.5.4 0.000 0.057 17.20 5.5.3 0.010 0.073 17.27 5.5.2 0.003 0.077 17.22 5.5.1 0.007 0.060 17.22 5.5.0 0.007 0.077 17.25 5.4.27 0.003 0.077 18.96 5.4.26 0.000 0.073 19.13 5.4.25 0.007 0.077 18.98 5.4.24 0.003 0.073 19.02 5.4.23 0.003 0.077 19.05 5.4.22 0.003 0.077 19.12 5.4.21 0.010 0.063 19.00 5.4.20 0.010 0.073 19.26 5.4.19 0.013 0.050 19.02 5.4.18 0.007 0.040 19.25 5.4.17 0.013 0.073 19.12 5.4.16 0.010 0.070 18.86 5.4.15 0.000 0.047 18.95 5.4.14 0.010 0.063 16.29 5.4.13 0.003 0.080 16.52 5.4.12 0.007 0.077 16.30 5.4.11 0.007 0.073 16.23 5.4.10 0.003 0.043 16.43 5.4.9 0.010 0.063 16.39 5.4.8 0.000 0.080 16.35 5.4.7 0.023 0.050 16.33 5.4.6 0.013 0.063 16.43 5.4.5 0.007 0.070 16.39 5.4.4 0.013 0.050 16.50 5.4.3 0.003 0.070 16.31 5.4.2 0.000 0.053 16.39 5.4.1 0.007 0.040 16.37 5.4.0 0.013 0.067 15.85 5.3.28 0.017 0.070 14.45 5.3.27 0.003 0.080 14.71 5.3.26 0.007 0.073 14.63 5.3.25 0.003 0.063 14.66 5.3.24 0.013 0.063 14.67 5.3.23 0.003 0.077 14.57 5.3.22 0.010 0.070 14.62 5.3.21 0.013 0.043 14.59 5.3.20 0.007 0.067 14.58 5.3.19 0.003 0.073 14.61 5.3.18 0.007 0.073 14.59 5.3.17 0.003 0.080 14.61 5.3.16 0.010 0.070 14.59 5.3.15 0.010 0.043 14.59 5.3.14 0.007 0.073 14.41 5.3.13 0.003 0.077 14.56 5.3.12 0.000 0.050 14.60 5.3.11 0.007 0.057 14.59 5.3.10 0.007 0.050 14.09 5.3.9 0.007 0.043 14.04 5.3.8 0.007 0.073 14.05 5.3.7 0.000 0.047 13.92 5.3.6 0.003 0.043 14.02 5.3.5 0.007 0.040 13.99 5.3.4 0.003 0.043 13.84 5.3.3 0.007 0.033 14.12 5.3.2 0.010 0.067 13.74 5.3.1 0.010 0.037 13.69 5.3.0 0.007 0.053 13.62
preferences:dark mode live preview
135.59 ms | 1394 KiB | 7 Q