Пожалуйста, посмотрите запрос
$query = "SELECT shop_groups_id as group_id, count(shop_items_catalog_item_id) as cnt FROM shop_items_catalog_table where shop_producers_list_id=". to_int($_GET['producer_id'])." group by shop_groups_id";
по-идее вместо to_int($_GET['producer_id']) мне нужно вставить $key, но строка
$query = "SELECT shop_groups_id as group_id, count(shop_items_catalog_item_id) as cnt FROM shop_items_catalog_table where shop_producers_list_id=". $key." group by shop_groups_id";
приводит к ошибке
Ошибка выполнения запроса! - 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 'group by shop_groups_id' at line 1
Что не так?
|