コード例 #1
0
 public function get_Question_HM($qid, $level)
 {
     $pdo = Database::getDB();
     $stmt = $pdo->prepare("SELECT * FROM brain_Question WHERE bid = ? AND level = ?");
     $stmt->execute(array($qid, $level));
     $row = $stmt->fetch();
     $brain_Question = new brain_Question();
     $brain_Question->setQid($row['bid']);
     $brain_Question->setfile_path($row['question_path']);
     $brain_Question->setSubject($row['subject']);
     $brain_Question->setLevel($row['level']);
     $brain_Question->setSubject($row['subject']);
     $brain_Question->setQuestion($row['question']);
     $brain_Question->setAnswer($row['answer']);
     $brain_Question->setHint($row['hint']);
     return $brain_Question;
 }