Have a table as below from MySQL Database 1. data is send from the user i.e "SchoolID" "StudCourse" "StudentSection" via ajax call to PHP 2. php gives a result which is username and three radio buttons Present, absent and Leave against that student 3. what i need is to capture the radio button data and send back to another PHP with that clicked radio button and the name or display in another div is also fine.
Data base
SchoolID StudentRegID StudentFirstName StudCourse StudentSection
FT001 12KQC31085 ABC BCOM A
FT001 12KQC31086 DEF BCOM A
FT001 12KQC31087 GHI BCOM A
FT001 12KQC31088 JKL BCOM A
$mysqli=mysqli_connect('localhost','Uname','Pass','Database');
//data from ajax
$standard1 = trim($_POST["tclass"]);
$section1 = trim($_POST["tsection"]);
$SchoolID1 = trim($_POST["tschoolid"]);
$query3="SELECT * FROM euser_student WHERE StudCourse='$standard1' and SchoolID='$SchoolID1'and StudentSection='$section1' order by StudentFirstName ASC";
$data3=mysqli_query($mysqli,$query3)or die(mysqli_error());
while($row=mysqli_fetch_array($data3)){
$dat3 = $row['StudentFirstName'];
// data to ajax to display data in a div
echo "<table><tr><td>".$dat3."</td><td><input name='".$dat3."' type='radio' value='Present'>Present</td><td><input name='".$dat3."' type='radio' value='Absent'>Absent</td><td><input name='".$dat3."' type='radio' value='Leave'>Leave</td></tr></table>";
}
Final Out Put
ABC O Present O Absent O Leave
DEF O Present O Absent O Leave
GHI O Present O Absent O Leave
JKL O Present O Absent O Leave
<input type="submit" id="submit_data" > </input>