I have a form that pulls up data from a database entry and allows you to edit the information. Everything works fine except for my radio buttons.
I have two buttons, one for Yes and one for No that both take in a value for a variable 'active'
When the page loads I need the radio button to automatically select whatever is in the db as the value for the variable. Thusly, if the user does not want to change the value, it will remain the same when the form is submitted and changes made to the table entry in the database.. Currently, this is what I have for code, it just tell you what the variable is set to currently.
<center>Active: Yes<input type="radio" name="active" value=yes>
No<input type="radio" name="active" value=no>
Currently Set to: <b><? echo $row['active'];?></b>
</center>
submitting the form sends the form information to a script that sets each variable in the database with the updated one. However, currently nothing gets set in those radio buttons so it always ends up being null in the database unless the user specifies a result. the idea being that if they want the value to stay 'Yes' they should not have to do anything to it, that it will just appear as selected.