Error displayed on screen bottom RH corner. Image is attached.
Code:
1055 'zc220_exp.pd.products_name' isn't in GROUP BY
in:
[SELECT p.products_id, pd.products_name, p.products_image, p.products_model, SUM(op.products_quantity) as total_sold FROM orders_products op JOIN orders o ON op.orders_id = o.orders_id JOIN products p ON op.products_id = p.products_id JOIN products_description pd ON (p.products_id = pd.products_id AND pd.language_id = 1) WHERE o.date_purchased >= DATE_SUB(NOW(), INTERVAL 30 DAY) GROUP BY p.products_id ORDER BY total_sold DESC LIMIT 5]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you entered valid data.
error-log
Code:
[12-Jan-2026 07:55:34 Australia/Brisbane] Request URI: /zc220_exp/public/admin/, IP address: 192.168.1.63, Language id 1#0 [internal function]: zen_debug_error_handler()
#1 E:\Web\zc220_exp\public\includes\classes\db\mysql\query_factory.php(757): trigger_error()
#2 E:\Web\zc220_exp\public\includes\classes\db\mysql\query_factory.php(701): queryFactory->show_error()
#3 E:\Web\zc220_exp\public\includes\classes\db\mysql\query_factory.php(314): queryFactory->set_error()
#4 E:\Web\zc220_exp\public\admin\includes\modules\dashboard_widgets\MostPopularProductsDashboardWidget.php(21): queryFactory->Execute()
#5 E:\Web\zc220_exp\public\admin\index_dashboard.php(141): include('E:\\Web\\zc220_ex...')
#6 E:\Web\zc220_exp\public\admin\home.php(27): require('E:\\Web\\zc220_ex...')
#7 E:\Web\zc220_exp\public\admin\index.php(16): require('E:\\Web\\zc220_ex...')
--> PHP Fatal error: FATAL MySQL error 1055: 'zc220_exp.pd.products_name' isn't in GROUP BY :: SELECT p.products_id, pd.products_name, p.products_image, p.products_model, SUM(op.products_quantity) as total_sold
FROM orders_products op
JOIN orders o ON op.orders_id = o.orders_id
JOIN products p ON op.products_id = p.products_id
JOIN products_description pd ON (p.products_id = pd.products_id AND pd.language_id = 1)
WHERE o.date_purchased >= DATE_SUB(NOW(), INTERVAL 30 DAY)
GROUP BY p.products_id
ORDER BY total_sold DESC
LIMIT 5 ==> (as called by) E:\Web\zc220_exp\public\admin\includes\modules\dashboard_widgets\MostPopularProductsDashboardWidget.php on line 21 <== in E:\Web\zc220_exp\public\includes\classes\db\mysql\query_factory.php on line 757.
Environment: Zen Cart 2.2.0; Apache 2.4.63; PHP 8.4.16; MySQL 11.8.5-MariaDB-log; Windows 11