syntax error, unexpected T_RETURN, expecting T_FUNCTION oop php

Chandler

New Member
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!\[code\] 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; \[/code\]
 
Back
Top