当我删除AS
子句时,此SQL查询非常有效。
$query = "SELECT bd_brushname FROM tbl_brushdescription WHERE MATCH(bd_brushname, bd_brushdescription) AGAINST ('brushes' IN BOOLEAN MODE) AS rank";
$sqlquery = mysql_query($query);
if($sqlquery === FALSE){
die(mysql_error());
}
当我使用AS
时,它会显示You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS rank' at line 1
有人可以告诉我为什么它不起作用吗?
答案 0 :(得分:0)
答案 1 :(得分:0)
更改“AS等级”的位置
$query = "SELECT bd_brushname AS rank FROM tbl_brushdescription WHERE MATCH(bd_brushname, bd_brushdescription) AGAINST ('brushes' IN BOOLEAN MODE)";
$sqlquery = mysql_query($query);
if($sqlquery === FALSE){
die(mysql_error());
}