Hi, Im receiving an error as stated above. Its referring to my return statement. Any one got any clues on this?! Thankful for all help! Regards!
public function getPosts() {
$result = $this->db->query("SELECT * FROM posts");
$posts = array();
while($posts = $result->fetch_assoc()) {
array_push($posts, new Post($post['id'], $post['created'], $post['author'], $post['title'], $post['body']));
}
}
return $posts;