pdo - PHP Catchable fatal error: Object of class could not be converted to string -
i lost here... after validating input create instance of message class , attempt insert data database: // send message $message = $this->model->build('message', true); $message->insertmessage($uid, $user->user_id, $title, $message); the method insertion straight-forward: // insert new message public function insertmessage($to_id, $from_id, $title, $body) { $sql = "insert messages (to_id, from_id, title, body, create_date) values (:to_id, :from_id, :title, :body, now())"; $sth = $this->db->prepare($sql); return $sth->execute([':to_id' => $to_id, ':from_id' => $from_id, ':title' => $title, ':body' => $body]); } however, upon submission end blank page , apache error log says: [tue jul 30 22:34:44 2013] [error] [client 127.0.0.1] php catchable fatal error: object of class framework\models\message not converted string in /var/www/p-lug/p-lu...