报告个小BUG

浏览:362 发布日期:2017/11/23 分类:ThinkPHP5专区
请看:\think\Db::view('Config', 'id, name, title, extra, remark, value')这一句$field参数中如果逗号后带空格,就会报:SQLSTATE[42000]: Syntax error or access violation: 1064 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 'name,Config. title FROM。。。这样的错误了。
在db/query.php的888行:if (is_string($field)) {
    $field = explode(',', $field);
}
感觉有必要对结果trim一下。
最佳答案
评论( 相关
后面还有条评论,点击查看>>