所以我得出的结论是,这个错误是由于两行特定的代码造成的。
$notification_object->flag = true;
$notification_object->save();
似乎抛出:
SQLSTATE[08P01]: <<Unknown error>>: 7 ERROR: bind message supplies 0 parameters, but prepared statement "pdo_stmt_0000000f" requires 1
有谁知道为什么?
根据要求提供更多信息
那么 $notifications_object 是如何创建的呢?
$notifications_table = new Users_Model_NotificationsMapper();
$notifications = $notifications_table->findByUserAndId($request, $identity->id);
然后我们循环遍历:
foreach($notifications as $notification_object){
//Do some code
//We need to now update a value in the database,
//essentially in the row we just got back.
$notifications_object->flag = true;
$notifications_object->save();
}