public function update($id, $postdata)
{
if ($this->user->getClass() < User::CLASS_ADMIN) {
throw new Exception(L::get("PERMISSION_DENIED"), 401);
}
$sth = $this->db->prepare("UPDATE faq SET type = ?, question = ?, answer = ?, flag = ?, categ = ?, `order` = ? WHERE id = ?");
$sth->bindParam(1, $postdata["type"], PDO::PARAM_STR);
$sth->bindParam(2, $postdata["question"], PDO::PARAM_STR);
$sth->bindParam(3, $postdata["answer"], PDO::PARAM_STR);
$sth->bindParam(4, $postdata["flag"], PDO::PARAM_INT);
$sth->bindParam(5, $postdata["categ"], PDO::PARAM_INT);
$sth->bindParam(6, $postdata["order"], PDO::PARAM_INT);
$sth->bindParam(7, $id, PDO::PARAM_INT);
$sth->execute();
}