SELECT COUNT(DISTINCT g.id) AS cnt FROM `goods` g JOIN ( SELECT 7016 AS category_id UNION ALL SELECT `child_id` FROM `category_tree` WHERE `parent_id` = 7016 ) AS ct ON g.category_id = ct.category_id; WHERE 1 AND g.`brand_id`='193'

Fatal error: Uncaught Error: Call to a member function fetch_assoc() on bool in /html/catalog.php:246 Stack trace: #0 {main} thrown in /html/catalog.php on line 246