本文整理汇总了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()