SELECT curs_code、count(*)as'count_of_curs' FROM cursus where curs_code ='$ id' group by curs_code リスト全体が必要な場合は、whereを削除します。