/** * @return int * @param Question $q */ public static function updateQuestion($q) { $db = DB::getConn(); $stm = $db->prepare('update Question set title=:title, category=:cate, point=:point, explain=:explain where id=:id'); $stm->bindParam(':title', $q->getTitle()); $stm->bindParam(':cate', $q->getCategory()); $stm->bindParam(':point', $q->getPoint()); $stm->bindParam(':explain', $q->getExplain()); $stm->bindParam(':id', $q->getId()); $stm->execute(); return QuestionCtrl::getLastID(); }