View Full Version : radio button data

06-08-2006, 04:19 AM
hi!! is there a way to capture the radio button selected into the database??

for example, 1 radio button is Yes, the other is No. How do i captured and update the table with Yes or No?

06-08-2006, 08:41 AM
$array_valid_options = array('Yes', 'No');
if (in_array($_POST['yourradiobuttonfield'], $array_valid_options){
$sql = "UPDATE yourtablename SET yourcolumnname=". $_POST['yourradiobuttonfield'] ." WHERE someIDfield=". $_SESSION['the_edited_ID'];
mysql_query($sql) or die('Queryproblem updating');
echo 'invalid choice';