อยากทราบการบันทึกข้อมูลการเข้าแถวของนักเรียน โดยใช้ radio button
<?php require_once("Connections/connection.php"); ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>ระบบเช็คชื่อนักเรียน</title>
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
th, td {
padding: 10px;
}
th{
background-color:lightgreen;
}
</style>
</head>
<body>
<h2 align=center> ระบบเช็คชื่อนักเรียน</h2>
<hr>
<?php
$query = "SELECT * FROM check_stu " or die("Error:" . mysqli_error());
$result = mysqli_query($con, $query);
mysql_query("SET NAMES utf8");
?>
<Form Action="result.php" Method="Post">
<?php
echo "<table border=1px align=center>";
echo "<th>เลขที่</th><th>ชื่อ-สกุล</th><th>มา</th><th>ขาด</th><th>ลา</th><th>กิจ</th>";
while ($data =mysqli_fetch_array($result))
{
$no = $data['stu_id'];
$name = $data['stu_name'];
$choice1 = $data['stu_ma'];
$choice2 = $data['stu_kad'];
$choice3 = $data['stu_la'];
$choice4 = $data['stu_kid'];
echo "<tr>";
echo "<td bgcolor=lightblue align=center>$no</td>";
echo "<td>$name</td>";
echo "<td align=center width=25px><Input Type=Radio Name=q[$no] Value=1 ></td>";
echo "<td align=center width=25px><Input Type=Radio Name=q[$no] Value=2 ></td>";
echo "<td align=center width=25px><Input Type=Radio Name=q[$no] Value=3 ></td>";
echo "<td align=center width=25px><Input Type=Radio Name=q[$no] Value=4 ></td></tr>";
}
echo "</table>
<p><center><button type='submit' value='Submit'>บันทึกข้อมูล</button>
<button type='reset' value='Reset'>ล้างข้อมูล</button></center>
</Form>";
?>
<?php
mysqli_close($con);
?>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>ระบบเช็คชื่อนักเรียน</title>
<style>
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
th, td {
padding: 10px;
}
th{
background-color:lightgreen;
}
</style>
</head>
<body>
<h2 align=center> ระบบเช็คชื่อนักเรียน</h2>
<hr>
<?php
$query = "SELECT * FROM check_stu " or die("Error:" . mysqli_error());
$result = mysqli_query($con, $query);
mysql_query("SET NAMES utf8");
?>
<Form Action="result.php" Method="Post">
<?php
echo "<table border=1px align=center>";
echo "<th>เลขที่</th><th>ชื่อ-สกุล</th><th>มา</th><th>ขาด</th><th>ลา</th><th>กิจ</th>";
while ($data =mysqli_fetch_array($result))
{
$no = $data['stu_id'];
$name = $data['stu_name'];
$choice1 = $data['stu_ma'];
$choice2 = $data['stu_kad'];
$choice3 = $data['stu_la'];
$choice4 = $data['stu_kid'];
echo "<tr>";
echo "<td bgcolor=lightblue align=center>$no</td>";
echo "<td>$name</td>";
echo "<td align=center width=25px><Input Type=Radio Name=q[$no] Value=1 ></td>";
echo "<td align=center width=25px><Input Type=Radio Name=q[$no] Value=2 ></td>";
echo "<td align=center width=25px><Input Type=Radio Name=q[$no] Value=3 ></td>";
echo "<td align=center width=25px><Input Type=Radio Name=q[$no] Value=4 ></td></tr>";
}
echo "</table>
<p><center><button type='submit' value='Submit'>บันทึกข้อมูล</button>
<button type='reset' value='Reset'>ล้างข้อมูล</button></center>
</Form>";
?>
<?php
mysqli_close($con);
?>
</body>
</html>
คำถามคือ ???