当前位置: 代码迷 >> 综合 >> PHP报错:this is incompatible with sql_mode=only_full_group_by
  详细解决方案

PHP报错:this is incompatible with sql_mode=only_full_group_by

热度:73   发布时间:2023-12-29 10:12:37.0

原因是mysql版本是5.7及以上, mysql默认配置是:sql_mode="ONLY_FULL_GROUP_BY"

加上这个代码使其兼容就可以

try {Db::execute("SET @@sql_mode='';");
} catch (\Exception $e) {
}

$res = db()->query('......');

  相关解决方案