本文整理汇总了PHP中AF::showAjaxQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP AF::showAjaxQuery方法的具体用法?PHP AF::showAjaxQuery怎么用?PHP AF::showAjaxQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AF
的用法示例。
在下文中一共展示了AF::showAjaxQuery方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rawQuery
/**
* private function which actually runs a query against Mysql server.
* also logs some stats like profiling info and error message
*
* @param string $query - a regular SQL query
* @return mysqli result resource or FALSE on error
*/
private function rawQuery($query)
{
$this->_insertID = null;
$start = microtime(TRUE);
$res = mysqli_query($this->conn, $query);
$insertID = mysqli_insert_id($this->conn);
if ($insertID) {
$this->_insertID = $insertID;
}
$timer = microtime(TRUE) - $start;
$this->countQuery++;
$this->stats[] = array('query' => $query, 'start' => $start, 'timer' => $timer);
if (AF::showAjaxQuery()) {
$query = htmlspecialchars("{$query}", ENT_QUOTES);
$query = str_replace(array("\n", "\r"), "", $query);
$content = '';
$contentA = $this->countQuery == 1 ? '$("div.service_info_querys div.ajax").show(); $("div.service_info_querys div.ajax div").html(""); ' : '';
$content .= '<br>' . $this->countQuery . '. Sql :<b>' . $query . '</b><br>Time: ' . $timer;
echo '<script> ' . $contentA . '$("div.service_info_querys div.ajax div").append(\'' . $content . '\'); /*count_sql_queries++; $("span#count_sql_queries").html(count_sql_queries)*/</script>';
}
if (!$res) {
$error = mysqli_error($this->conn);
end($this->stats);
$key = key($this->stats);
$this->stats[$key]['error'] = $error;
$this->cutStats();
$this->error("{$error}. Full query: [{$query}]");
}
$this->cutStats();
/*
//temp sql collection
$s=strtolower(substr(trim($query), 0, 23));
if($s!='update `users_sessions`')
{
$md5=md5($query);
$query=str_replace("'", "\'", $query);
$query=str_replace('"', '\"', $query);
$type=strtolower(substr(trim($query), 0, 6));
$tSql="INSERT INTO `temp_sql_stat` SET `type`='{$type}', `md5`='{$md5}', `sql`='{$query}', `request_url`='{$_SERVER['REQUEST_URI']}'";
mysqli_query($this->conn, $tSql);
}
*/
//file_put_contents('/home/limejuic/public_html/lj3/sql_log.log', $query."\n --------- \n", FILE_APPEND);
return $res;
}