Code: Select all
<form id="form1" name="form1" method="POST" action="testvalue.php">
<?php
//ดึงข้อมูลส่วนตัวจากตาราง topic หมวดวิทยากรผู้บรรยาย < -------------------------------------------------------------------------------------------------------------------
$sqltopic = "SELECT * FROM topic WHERE project_id = $project_id AND topic_type = '3' ORDER BY topic_id ";
$sqltopic = mysql_query($sqltopic) or die("success=0");
while ($data = mysql_fetch_array($sqltopic))
{
$topic_id = $data['topic_id'];
$topic_title = $data['topic_title'];
echo "<table>";
echo "<tr>";
echo "<th width=700 border=0 align=left>$topic_title</th>";
//อ่านตัวเลือกจากตาราง choice มาเป็น input radio
$sqlchoice = "SELECT * FROM choice WHERE topic_id = $topic_id ORDER BY choice_id";
$sqlchoice = mysql_query($sqlchoice) or die("success=0");
while ($data2 = mysql_fetch_array($sqlchoice))
{
//แสดง Radio ในการเลือก
echo "<th width='100' align='center'>
<input type = radio name='{$data['topic_id']}' VALUE ='{$data2['choice_id']}'>
</th>";
}
echo "</tr>";
echo "</table>";
}
?>
<input type="submit" name="Submit" id="Submit" value=" บันทึกข้อมูล " />