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.
- SELECT IF(`sex`=1,'Male','Female') FROM ...
复制代码- SELECT ... FROM (SELECT ... FROM ...) AS `XXX`
复制代码- $_config['security']['querysafe']['status'] = 1;
复制代码 |
|