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')");
精彩评论