I am doning one page where the packages are listed from database with a radio button it needs to save packname and echo which pack is selected
Standard Packages
<?php
echo "<table border='1'>";
echo "<th>Select</th>";
echo "<th>Package Name</th>";
echo "<th>Service Type</th>";
echo "<th>Service Name</th>";
echo "<th>Sessions</th>";
echo "<th>Price</th>";
while($row = mysqli_fetch_array($sql))
{
echo "<tr>";
$checked=isset($_POST["radio"]) && $_POST["radio"]==="oneway"?"checked":"";
echo '<td><input type="radio" name="radio" id="oneway" value="oneway"<?php echo $checked;?></td>';
echo "<td>".$row['packname']."</td>";
echo "<td>".$row['ServiceType']."</td>";
echo "<td>".$row['ServiceName']."</td>";
echo "<td>".$row['Sessions']."</td>";
echo "<td>".$row['Price']."</td>";
echo "</tr>";
}
echo "</table>";
echo "</div>";
mysqli_close ($db);
?>
</table>