Ok, So I have a radio button in a while statement...
If the user click the radio button, I want the session variable of order_nums to change to the data['order_num] that relates to that radio button id... How can I achieve this?
Here is my code.
<?php
$num = '1';
while($data=$stmts->fetch(PDO::FETCH_ASSOC))
{
if($_SESSION['order_nums'] == $data['order_num'])
{
echo "<input type='radio' id='$num++' name='ac'>" . '<label>ACTIVE:</label>' . $data['order_num'];
echo "<br>";
} else
{
echo "<input type='radio' id='$num++' name='ac'>" . $data['order_num'];
echo "<br>";
}
}
?>