开发者

Mysql match query problem

开发者 https://www.devze.com 2023-01-26 15:30 出处:网络
Natural Language Full-Text Searches I use the mysql Match function. What\'s wrong with it? $ititle = wp_title(\'\',0,\'\');

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

精彩评论

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