function getTopics($showId) { require 'config.php'; $postArray = array(); $sql = $connect->query("SELECT `topics` . `id` FROM `topics` WHERE `topics` . `parentShow_Id` = '{$showId}'"); while ($row = $sql->fetch_object()) { $topics = new topic($row->id); array_push($postArray, array("threadId" => $topics->getThreadId(), "title" => $topics->getTitle(), "description" => $topics->getDescription(), "dateTime" => $topics->getDateCreated(), "by" => $topics->getCreator(), "count" => $topics->getPostCount())); } return $postArray; }