当我尝试更新数据库中的记录时出现此错误。是因为" fetch"?我知道INSERT不能使用fetch / fetchall,update是一回事吗?
public function inActive($id) {
$stmt = $this->dbh->prepare("Update " . self::TABLE_NAME . " Set `IsActive`=0 WHERE `ID`=:id");
$stmt->bindParam(':id', $id);
return $this->execute($stmt);
}
protected function execute($stmt) {
$stmt->setFetchMode(PDO::FETCH_CLASS, 'ContactVO');
$stmt->execute();
$vo = array();
try {
while ($row = $stmt->fetch()) {
$vo [] = $row;
}
} catch (PDOException $e) {
echo 'Error: ' . $e->getMessage();
}
return $vo;
}