您好!关于ECSHOP后台报错 MySQL server error report 请问您是怎么解决的呢?谢谢!
MySQLservererrorreport:Array([0]=>Array([message]=>MySQLQueryError)[1]=>Array([sql]=>...
MySQL server error report:Array ( [0] => Array ( [message] => MySQL Query Error ) [1] => Array ( [sql] => select IFNULL(count(*),0) from `xf_db`.`rd_comment` where id_value= ) [2] => Array ( [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 '' at line 1 ) [3] => Array ( [errno] => 1064 ) )
展开
展开全部
select IFNULL(count(*),0) from `xf_db`.`rd_comment` where id_value=
Mysql 语句的语法错误,id_value= 后面不能没有值,请检查php代码中id_value的赋值。
更多追问追答
追问
php代码是这样的:
$sql = "select IFNULL(count(*),0) from ". $GLOBALS['ecs']->table('comment') ." where id_value=$goods_id" ;
我把$goods_id直接替换成1或0也不行,请问要如何修改呢?
追答
你需要确保$goods_id的变量可以获取到值才可以。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询