Good Afternoon. I just want to ask a Question but before that let me explain it to all of you in a best way I can
As of now I have the ff.
Database: Election2016
Table: Candidate_Info
Fields: CandidateName and Position
As of now here is my code and the output of this is Show the Data in HTML Table
<html>
<center>
<font size="2" face = "century gothic">
<?php
$con = mysqli_connect("localhost", "root", "", "election2016");
// Check connection
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con, "SELECT * FROM candidate_info");
echo "<table border='1'>
<tr>
<th>CandidateName</th>
<th>Position</th>
</tr>";
while ($row = mysqli_fetch_array($result)) {
echo "<tr>";
echo "<td>" . $row['CandidateName'] . "</td>";
echo "<td>" . $row['Position'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysqli_close($con);
?>
</center>
</font>
</html>
And my target here is how can I attach a Radio Button to it? next to it? Attach a Radio Button in every row populated.
and my next target here which is very tricky to me is that when I press a button how will the data i choose with the corresponding radiobutton will be saved?
Example:
Candidate Name
Student 1
Position
President
Radio Button 1 (Example name of the Radio Button)
I selected RadioButton1 and press button "Save" how will Student 1 and President will be saved in a table?
I hope you understand TYIA