level 1
四三九九🌚
楼主
我想做的是當我按下submit,我會轉跳到同一頁,但?no是+1的,但永遠都加不到,想問為什麼
if (isset($_POST["Submit"])){
$add_no = $_GET['no']+1;
$sql = "UPDATE exam SET q1_context='". $_POST["textdata"]."' Where stu_id ='".$_SESSION['stu_id']."'";
$stmt = $pdo->prepare($sql);
$stmt->execute();
$next_link = "location: exam_question.php?no=".$add_no;
header($next_link);
}
2022年03月05日 14点03分
1
if (isset($_POST["Submit"])){
$add_no = $_GET['no']+1;
$sql = "UPDATE exam SET q1_context='". $_POST["textdata"]."' Where stu_id ='".$_SESSION['stu_id']."'";
$stmt = $pdo->prepare($sql);
$stmt->execute();
$next_link = "location: exam_question.php?no=".$add_no;
header($next_link);
}