Подсчет потомков узла в MySQL?
SELECT s1.*, count(s2.id_sections)
FROM sections s1
LEFT JOIN sections s2 ON s2.parent = s1.id_sections
WHERE s1.parent = 0
GROUP BY s1.id_sections


не?
А такое MySQL разве не умеет?
SELECT *, (SELECT COUNT(*) FROM sections s2 WHERE s2.parent = s1.id_sections)
FROM sections s1
WHERE s1.parent = 0
