本文整理匯總了PHP中s::sqlEscape方法的典型用法代碼示例。如果您正苦於以下問題:PHP s::sqlEscape方法的具體用法?PHP s::sqlEscape怎麽用?PHP s::sqlEscape使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類s
的用法示例。
在下文中一共展示了s::sqlEscape方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: trim
$addsql = '';
if ($keyword) {
$keyword = trim($keyword);
$keywordarray = explode(",", $keyword);
foreach ($keywordarray as $value) {
$value = str_replace('*', '%', $value);
$keywhere .= " OR keyword LIKE " . S::sqlEscape("%{$value}%");
}
$keywhere = substr_replace($keywhere, "", 0, 3);
$addsql .= " AND ({$keywhere}) ";
}
if ($createtime_s) {
$addsql .= " AND created_time >= " . s::sqlEscape(PwStrtoTime($createtime_s));
}
if ($createtime_e) {
$addsql .= " AND created_time <= " . s::sqlEscape(PwStrtoTime($createtime_e));
}
$statisticDb = array();
$sql = "SELECT keyword, sum( num ) AS times FROM `pw_searchstatistic` WHERE 1 {$addsql} GROUP BY keyword ORDER BY times DESC LIMIT 0 , 500";
$qurey = $db->query($sql);
while ($rt = $db->fetch_array($qurey)) {
$rt['keyword'] = str_replace(array(" ", "=", " ", "<", "<", ">", ">", "(", ")", ")"), array(" "), $rt['keyword']);
$statisticDb[] = $rt;
}
}
include PrintEot('searcher');
exit;
/**
* 更新緩存
*/
function updatecache_search()