ok i fixed that with
$sql = "SELECT s.`id`, s.`topic`, s.`username`, s.`date`, s.`subject`, s.`post`, COUNT(c.`posts_id`) AS `ct` FROM `forum-posts` s LEFT JOIN `forum-reply` c ON s.`subject` = c.`posts_id` WHERE s.`topic` = '$topic' GROUP BY s.`id`";
now i need to get the same thing working here.
$sql = "SELECT s.`id`, s.`catagory`, c.`title`, c.`about`, COUNT(d.`posts_id`) AS `ct` FROM `forum-posts` d LEFT JOIN `forum-catagory` s LEFT JOIN `forum-topics` c ON s.`id` = c.`catagory_id` ORDER BY s.`id`";