MySQL err: MySQL server has gone away SELECT title, categoryID, (SELECT COUNT(categoryID) FROM productsCategories WHERE productsCategories.categoryID = category.categoryID) AS 'products'
FROM category
WHERE parentID = 0
ORDER BY products DESC
LIMIT 10