所以我希望能够更改列出搜索查询结果的方式。顶部(按相关性排序)有效,但是当我尝试通过同一数据库中的不同变量进行排序时,它不起作用。有什么建议?拜托,谢谢。
if(!isset($_SESSION['sortby']) or $qsortby=="relevance")
{
$result =
"SELECT *,
MATCH (title, keywords) AGAINST ('+".$q."' IN BOOLEAN MODE) AS relevance,
MATCH (title) AGAINST ('+".$q."' IN BOOLEAN MODE) AS title_relevance
FROM designs
WHERE MATCH (title, keywords) AGAINST ('".$q."')
ORDER BY title_relevance DESC, relevance DESC";
}
else
{
$result =
"SELECT *,
MATCH (title, keywords) AGAINST ('+".$q."' IN BOOLEAN MODE) AS relevance,
FROM designs
WHERE MATCH (title, keywords) AGAINST ('".$q."')
ORDER BY rating DESC";
}