Im getting the error as above. This applies to my return application. Does anyone have any clues? Thanks for the help! Hello!
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;
source
share