自然语言全文搜索 我使用mysql Match功能。怎么了?
$ititle = wp_title('',0,'');
$query = mysql_query("SELECT posttitle, posturl, siteurl MATCH (posttitle, posturl, siteurl) AGAINST $ititle AS score FROM interlinks WHERE MATCH (posttitle, posturl, siteurl) AGAINST $ititle AND title <> $ititle");
TY
答案 0 :(得分:0)
您需要在AGAINST
条件中的变量周围添加括号和引号。
AGAINST ('$ititle')
答案 1 :(得分:0)
搞定了,这是代码:
$ititle = wp_title('',0,'');
$query = mysql_query("SELECT posttitle, posturl, siteurl, MATCH (posttitle,posturl,siteurl) AGAINST ('$ititle') AS score FROM interlinks WHERE MATCH (posttitle,posturl,siteurl) AGAINST ('$ititle')");