public function saveExistingPost(Post $post) { $postId = $post->getPostId(); $isAnsweredByDoctor = $post->getDoctor(); $stmt = $this->db->prepare("UPDATE posts " . "SET isAnsweredByDoctor=:isAnsweredByDoctor WHERE postId=:postId"); $stmt->execute([':postId' => $postId, ':isAnsweredByDoctor' => $isAnsweredByDoctor]); }