所以我得出结论,这个错误是因为两行特定的代码。
$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();
}