Discuz! It is not safe to do this query 的解决方法

Nokia 2015/12/20 06:15 | 显示全部楼层
It is not safe to do this query是Discuz!认为查询数据库时执行了不安全的SQL语句时报出的错误,比如SQL中使用到了MySQL的if()函数或者子查询等高级查询。
Discuz!插件出现It is not safe to do this query时,可以修改配置文件 config/config_global.php 来禁止SQL安全检测,修改方法是:将$_config['security']['querysafe']['status']的值从1改为0.
  1. SELECT IF(`sex`=1,'Male','Female') FROM ...
复制代码
  1. SELECT ... FROM (SELECT ... FROM ...) AS `XXX`
复制代码
  1. $_config['security']['querysafe']['status'] = 1;
复制代码

手机版|轻松E站

返回顶部 返回列表