1 Star 0 Fork 0

Blood.Cold/nexusphp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
searchsuggest.php 634 Bytes
一键复制 编辑 原始数据 按行查看 历史
xiaomlove 提交于 2020-12-26 01:42 . init
<?php
require "include/bittorrent.php";
dbconn();
if (isset($_GET['q']) && $_GET['q'] != '')
{
$searchstr = trim($_GET['q']);
$suggest_query = sql_query("SELECT keywords AS suggest, COUNT(*) AS count FROM suggest WHERE keywords LIKE " . sqlesc($searchstr . "%")." GROUP BY keywords ORDER BY count DESC, keywords DESC LIMIT 10");
$result = array($searchstr, array(), array());
while($suggest = mysql_fetch_array($suggest_query)){
if (strlen($suggest['suggest']) > 25) continue;
$result[1][] = $suggest['suggest'];
$result[2][] = $suggest['count']." times";
$i++;
if ($i >= 5) break;
}
echo json_encode($result);
}
?>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/scruixin_Blood/nexusphp.git
git@gitee.com:scruixin_Blood/nexusphp.git
scruixin_Blood
nexusphp
nexusphp
master

搜索帮助