ユーザーが試験を作成するたびに、連続したアイテム番号を挿入したいと思います。彼が試験を作成するたびに、それは 1 に戻ります。皆さん、私はあなたの助けが非常に必要です。もっと力を。:)
ここに私のコードがあります:
$examid = $_SESSION['examid'];
$itemnum = 1;
$sql = mysql_query("INSERT INTO exam_questions (question_description, question_type, question_exam_id) VALUES ('$question', '$type', '$examid')")or die(mysql_error());
$lastinsertid = mysql_insert_id();
mysql_query("UPDATE exam_questions SET question_set_id='<??????????>' WHERE question_id='$lastinsertid' LIMIT 1")or die(mysql_error());