SELECT forums.*, COUNT(threads.id) FROM `forums`, `threads` WHERE forums.parent = "cat.1" AND threads.forum=forums.id GROUP BY forums.id