开发者

Mysql match query problem

Natural Language Full-Text Searches I use the mysql Match function. What's wrong with it?

$ititle = wp_title('',0,'');


$query = mysql_query("SELECT posttitle, posturl, siteurl MATCH (posttitle, posturl, siteurl) AGAINST $ititle AS score FROM开发者_StackOverflow interlinks WHERE MATCH (posttitle, posturl, siteurl) AGAINST $ititle AND title <> $ititle");

TY


You need to add parentheses and quotation marks around the variable in the AGAINST conditions.

AGAINST ('$ititle')


Got it working, here is the code:

$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')");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜