tbl index.tbl如下所示:
id | Url | Description
0 | http://cheapnames.it | Register Domain Names from $1 to $25.
1 | http://lownames.usa | Get Domain Names from $1 to $20.
2 | http://lowcostnames.uk | Register Domains for as low as $1.
3 | http://getdoman.biz | Register Names from between $1 to $25.
现在,假设您搜索了“注册域名”。
我希望查询根据最匹配的关键字(匹配数)对行进行排名。因此,从我们的示例来看,排名应该是这样的:
0| http://cheapnames.it | Register Domain Names from $1 to $25.
1| http://lownames.usa | Get Domain Names from $1 to $20.
3| http://getdoman.biz | Register Names from between $1 to $25.
2| http://lowcostnames.uk | Register Domains for as low as $1.
问题:
您将如何编写Sql查询来像我描述的那样进行查询和排名?
仅仅是Sql查询在这里足以进行描述的排名显示,还是必须获取php才能进行排名显示?或者,也许Sql除了php之外根本不应该进行排名显示?在那种情况下,我可以看看php示例代码吗?
到目前为止我没有得到什么好处
$query = "SELECT * FROM notices WHERE description = register AND Domain AND
Names";
请将代码示例显示为我的示例无法处理“最匹配排名”。