Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/62.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 针对语法错误的MySQL匹配_Php_Mysql_Debugging_Search_Syntax Error - Fatal编程技术网

Php 针对语法错误的MySQL匹配

Php 针对语法错误的MySQL匹配,php,mysql,debugging,search,syntax-error,Php,Mysql,Debugging,Search,Syntax Error,我在这里使用搜索脚本: 该脚本在本地主机上运行良好,但在实时主机上显示以下错误 > 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 'MATCH (title,description,keywords) AGAINST('somesearchterm' at line 1

我在这里使用搜索脚本:

该脚本在本地主机上运行良好,但在实时主机上显示以下错误

> 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 'MATCH (title,description,keywords) AGAINST('somesearchterm' at line 1
直播主机上的Mysql版本为5.1

下面是脚本中指向错误的部分

$sCount=rowCount('search_pages','WHERE MATCH(title,description,keywords) AGAINST(\''.safeImport($searchterm).'\' IN BOOLEAN MODE)');
$s_query=mysql_query("SELECT * FROM ".$database['prefix']."search_pages WHERE MATCH(title,description,keywords) AGAINST ('".safeImport($searchterm)."' IN BOOLEAN MODE) ORDER BY title LIMIT $limit,$SETTINGS->total") or die(mysql_error());

问题是什么?

如果live版本是5.1,那么本地主机的MySQL版本是什么?可能相关吗?另一个相关的问题/问题,尽管看起来您的代码已经有了这个问题的答案:是的,我已经实现了布尔模式,但仍然无法确定问题出在哪里?您可以输出实际的查询,如
echo“SELECT*FROM”。$database['prefix']”。搜索匹配的页面吗(标题、说明、关键字)根据(“.”.safeImport($searchterm)。“”在布尔模式下)按标题限制排序$LIMIT,$SETTINGS->total”)
,因为我们不知道safeImport将返回什么