本文整理汇总了PHP中Sqlite::rawquery方法的典型用法代码示例。如果您正苦于以下问题:PHP Sqlite::rawquery方法的具体用法?PHP Sqlite::rawquery怎么用?PHP Sqlite::rawquery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sqlite
的用法示例。
在下文中一共展示了Sqlite::rawquery方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: clearTrafficTable
function clearTrafficTable()
{
$sql = new Sqlite(null, "vpstraffic");
$sql->rawquery("delete from vpstraffic;");
}
示例2: initVirtualListIfUndef
protected final function initVirtualListIfUndef($class)
{
global $gbl, $sgbl, $login, $ghtml;
$list = "{$class}_l";
//list($iclass, $mclass, $rclass) = get_composite($class);
$rclass = $class;
$this->__list_list = array_push_unique($this->__list_list, $class);
$typevar = "__listtype_{$class}";
$totalvar = "__virtualtotal_{$class}";
if (!isset($this->{$list})) {
$this->{$list} = null;
}
if (isset($this->{$typevar}) && ($this->{$typevar} === 'fullist' || $this->{$typevar} === 'virtuallist')) {
return $this->{$totalvar};
}
$this->backuplist = $this->{$list};
if ($rule = exec_class_method($rclass, 'initThisListRule', $this, $class)) {
$query = $this->getDefaultQuery($class, $rule);
//dprint(' <br> ' .$query . "<br> \n");
$filter = $this->getFilterForThis($class);
$string = exec_class_method($rclass, "getdbFilter", $filter, $class);
if ($string) {
if ($query) {
$query .= " AND {$string}";
} else {
$query .= " where {$string}";
}
}
$db = new Sqlite($this->__masterserver, $this->getTheTable($rclass));
$countquery = $query;
$table = $this->getTheTable($rclass);
print_time('count');
//$db->rawquery("begin;");
$countres = $db->rawquery("select count(*) from {$table} {$countquery}");
if ($sgbl->__var_database_type === 'mysql') {
$countres = $countres[0]['count(*)'];
} else {
if ($sgbl->__var_database_type === 'mssql') {
$countres = $countres[0]['computed'];
} else {
$countres = $countres[0]['count(*)'];
}
}
//print_time('count', "CountResult");
print_time('getdb');
$f = $this->getDbOrderLimit($filter, $countres, $class);
$table = $this->getTheTable($rclass);
$sortby = $f['sortby'];
$sortdir = $f['sortdir'];
$skiprows = $f['skiprows'];
$pagesize = $f['pagesize'];
$revsortdir = $f['revsortdir'];
if ($sgbl->__var_database_type === 'mysql') {
$desc = get_classvar_description($class, $sortby);
if (csa($desc[0], "q")) {
$sortby = "(used_q_{$sortby} + 0)";
}
$query = "select * from {$table} {$countquery} order by {$sortby} {$sortdir} limit {$skiprows}, {$pagesize}";
} else {
if ($sgbl->__var_database_type === 'mssql') {
$tot = $pagesize + $skiprows;
$query = "select * from (select top {$pagesize} * from ( select top {$tot} * from {$table} {$countquery} order by {$sortby} {$sortdir} ) as t_{$table} order by {$sortby} {$revsortdir}) as t2_{$table} order by {$sortby} {$sortdir}";
} else {
$query = "select * from {$table} {$countquery} order by {$sortby} {$sortdir} limit {$skiprows}, {$pagesize}";
}
}
$res = $db->rawQuery($query);
//$db->rawquery("commit;");
//print_time('getdb', 'GetResult');
} else {
$res = exec_class_method($rclass, 'initThisList', $this, $class);
$countres = count($res);
}
//$this->ApplyFilter($res);
$this->setListFromArray($this->__masterserver, $this->__readserver, $class, $res);
foreach ((array) $this->backuplist as $v) {
$this->{$list}[$v->nname] = $v;
}
$this->{$typevar} = 'virtuallist';
$this->{$totalvar} = $countres;
return $countres;
}
示例3: check_raw_password
function check_raw_password($class, $client, $pass)
{
//return true;
if (!$class || !$client || !$pass) {
return false;
}
$rawdb = new Sqlite(null, $class);
$password = $rawdb->rawquery("select password from {$class} where nname = '{$client}'");
$enp = $password[0]['password'];
if ($enp && check_password($pass, $enp)) {
return true;
}
return false;
//$rawdb->close();
}
示例4: check_raw_password
function check_raw_password($class, $client, $pass)
{
//return true;
if (!$class || !$client || !$pass) {
return false;
}
$rawdb = new Sqlite(null, $class);
// LxCenter - DT30011014
$password = $rawdb->rawquery("select password from " . mysql_real_escape_string($class) . " where nname = '" . mysql_real_escape_string($client) . "'");
$enp = $password[0]['password'];
if ($enp && check_password($pass, $enp)) {
return true;
}
return false;
//$rawdb->close();
}