[10501] PDOException in Connection.php line 699

SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #5 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'gpccart.op.products_name' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

  1. $this->debug(false, '', $master);
  2. // 返回结果集
  3. return $this->getResult($pdo, $procedure);
  4. } catch (\PDOException $e) {
  5. if ($this->isBreak($e)) {
  6. return $this->close()->query($sql, $bind, $master, $pdo);
  7. }
  8. throw new PDOException($e, $this->config, $this->getLastsql());
  9. } catch (\Throwable $e) {
  10. if ($this->isBreak($e)) {
  11. return $this->close()->query($sql, $bind, $master, $pdo);
  12. }
  13. throw $e;
  14. } catch (\Exception $e) {
  15. if ($this->isBreak($e)) {
  16. return $this->close()->query($sql, $bind, $master, $pdo);

Call Stack

  1. in Connection.php line 699
  2. at Connection->query('SELECT p.products_id...', ['where_AND_p_manufacturers_id' => ['26', 2], 'where_AND_p_manufacturers_series_id_in_1' => ['481', 2], 'where_AND_p_manufacturers_series_id_in_2' => ['589', 2], ...], false, false) in Connection.php line 938
  3. at Connection->select(object(Query)) in Query.php line 2807
  4. at Query->select() in Query.php line 1753
  5. at Query->paginate(5) in Brand.php line 315
  6. at Brand->hot_sale_list('26', 481, 5) in Brand.php line 289
  7. at Brand->brand_cate('26')
  8. at ReflectionMethod->invokeArgs(object(Brand), ['26']) in Container.php line 355
  9. at Container->invokeReflectMethod(object(Brand), object(ReflectionMethod), ['b_id' => '26']) in Module.php line 129
  10. at Module->think\route\dispatch\{closure}(object(Request), object(Closure), null)
  11. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 176
  12. at Middleware->think\{closure}(object(Request))
  13. at call_user_func(object(Closure), object(Request)) in Middleware.php line 121
  14. at Middleware->dispatch(object(Request), 'controller') in Module.php line 134
  15. at Module->exec() in Dispatch.php line 167
  16. at Dispatch->run() in App.php line 432
  17. at App->think\{closure}(object(Request), object(Closure), null)
  18. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 176
  19. at Middleware->think\{closure}(object(Request))
  20. at call_user_func(object(Closure), object(Request)) in Middleware.php line 121
  21. at Middleware->dispatch(object(Request)) in App.php line 435
  22. at App->run() in tp7.php line 23

Exception Datas

PDO Error Info
SQLSTATE 42000
Driver Error Code 1055
Driver Error Message Expression #5 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'gpccart.op.products_name' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
Database Status
Error Code 10501
Error Message SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #5 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'gpccart.op.products_name' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
Error SQL SELECT p.products_id,p.manufacturers_series_id, p.products_price, p.products_image, op.products_name,sum(op.products_quantity) as sale FROM `orders_products` `op` INNER JOIN `products` `p` ON `op`.`products_id`=`p`.`products_id` WHERE `p`.`manufacturers_id` = '26' AND `p`.`manufacturers_series_id` IN ('481','589','663','664','665','666','667','668','672','2048','7153','7154','7155','7156','7166','590','680','2012','2009','7163','7164','7165','2013','2015','7157','7158','7159','7160','7161','7162','2021','592','1996','7170','7171','7172','7173','7169','593','704','1993','7178','1995','7174','7175','7176') GROUP BY `op`.`products_id` ORDER BY `sale` DESC LIMIT 0,5
Database Config
type mysql
hostname rm-wz9n99e7id2n306u6ao.mysql.rds.aliyuncs.com
database gpccart
hostport 3306
dsn
params []
charset utf8
prefix
debug true
deploy 0
rw_separate false
master_num 1
slave_no
read_master false
fields_strict true
resultset_type array
auto_timestamp false
datetime_format Y-m-d H:i:s
sql_explain false
builder
query \think\db\Query
break_reconnect false
break_match_str []
db2 { "type": "mysql", "hostname": "127.0.0.1", "database": "gpccart", "username": "gpccart", "password": "gpc0771", "hostport": "", "params": [], "charset": "utf8", "prefix": "" }
db3 { "type": "mysql", "hostname": "127.0.0.1", "database": "test", "username": "gpccart", "password": "gpc0771", "hostport": "", "params": [], "charset": "utf8", "prefix": "" }

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
HTTP_CONNECTION close
HTTP_HOST www.gpcang.com
PHP_ADMIN_VALUE open_basedir=/www/wwwroot/www.gpcang.com/:/www/wwwroot/www.gpcang.com/images/:/www/wwwroot/www.gpcang.com/tp5/:/www/wwwroot/www.gpcang.com/tp5/application/:/tmp/
PATH_INFO
REDIRECT_STATUS 200
SERVER_NAME www.gpcang.com
SERVER_PORT 443
SERVER_ADDR 172.18.36.102
REMOTE_PORT 43756
REMOTE_ADDR 39.108.54.53
SERVER_SOFTWARE nginx/1.8.1
GATEWAY_INTERFACE CGI/1.1
HTTPS on
SERVER_PROTOCOL HTTP/1.0
DOCUMENT_ROOT /www/wwwroot/www.gpcang.com
DOCUMENT_URI /tp5/tp7.php
REQUEST_URI /tp5/tp7.php?s=Brand/brand_cate/b_id/26.html
SCRIPT_NAME /tp5/tp7.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=Brand/brand_cate/b_id/26.html
SCRIPT_FILENAME /www/wwwroot/www.gpcang.com/tp5/tp7.php
FCGI_ROLE RESPONDER
PHP_SELF /tp5/tp7.php
REQUEST_TIME_FLOAT 1710831586.3926
REQUEST_TIME 1710831586
Environment Variablesempty
ThinkPHP Constants
APP_PATH /www/wwwroot/www.gpcang.com/tp5/application/
THINK_VERSION 5.0.15
THINK_START_TIME 1710831586.3932
THINK_START_MEM 422408
EXT .php
DS /
THINK_PATH /www/wwwroot/www.gpcang.com/tp5/thinkphp/
LIB_PATH /www/wwwroot/www.gpcang.com/tp5/thinkphp/library/
CORE_PATH /www/wwwroot/www.gpcang.com/tp5/thinkphp/library/think/
TRAIT_PATH /www/wwwroot/www.gpcang.com/tp5/thinkphp/library/traits/
ROOT_PATH /www/wwwroot/www.gpcang.com/tp5/
EXTEND_PATH /www/wwwroot/www.gpcang.com/tp5/extend/
VENDOR_PATH /www/wwwroot/www.gpcang.com/tp5/vendor/
RUNTIME_PATH /www/wwwroot/www.gpcang.com/tp5/runtime/
LOG_PATH /www/wwwroot/www.gpcang.com/tp5/runtime/log/
CACHE_PATH /www/wwwroot/www.gpcang.com/tp5/runtime/cache/
TEMP_PATH /www/wwwroot/www.gpcang.com/tp5/runtime/temp/
CONF_PATH /www/wwwroot/www.gpcang.com/tp5/application/
CONF_EXT .php
ENV_PREFIX PHP_