我在这里做错了什么?
NSO的Php代码
if(!isset($_POST["nso"])) {
$message = "NSO is required";
}else {
$message = "Did not submit NSO";
}
选择
$sql = mysqli_query($conn, "SELECT * FROM student_prof where studentID = '$id' ") or die("Error: " . mysqli_error($conn));
while($row=mysqli_fetch_array($sql,MYSQLI_ASSOC)){
Html代码
<input type="radio" name="nso" value="Submitted" <?php if(isset($_POST['nso']) && $_POST['nso']=="Submitted") echo 'checked="checked"' ?>> Submitted<br>
<input type="radio" name="nso" value="Not Submitted" <?php if(isset($_POST['nso']) && $_POST['nso']=="Not Submitted") echo 'checked="checked"' ?>>Not Submitted
答案 0 :(得分:0)
根据您的代码
<input type="radio" name="nso" value="Submitted" <?php if(isset($_POST['nso']) && $_POST['nso']=="Submitted") echo "checked" ?>> Submitted<br>
<input type="radio" name="nso" value="Not Submitted" <?php if(isset($_POST['nso']) && $_POST['nso']=="Not Submitted") echo "checked" ?>>Not Submitted
基于选择查询
<input type="radio" name="nso" value="Submitted" <?php if(isset($row['nso']) && $row['nso']=="Submitted") echo "checked" ?>> Submitted<br>
<input type="radio" name="nso" value="Not Submitted" <?php if(isset($row['nso']) && $row['nso']=="Not Submitted") echo "checked" ?>>Not Submitted