Lost connection to MySQL server at 'reading initial communication packet', system error: 54
SELECT node.*, (COUNT(parent.cat_id) - 1) AS level, m.urlname FROM categories AS parent, categories AS node LEFT JOIN maincategories AS m ON m.cat_id = node.maincat_id WHERE node.left_id BETWEEN parent.left_id AND parent.right_id AND node.maincat_id=0 AND parent.maincat_id = 0 GROUP BY node.cat_id ORDER BY node.left_id
Вернуться назад