Harshad Patel
Harshad Patel

Reputation: 9

How to retrive and update radio button's data from mysql database?

CODE am trying:

<input type="radio" name="type" value="Male" <?php if ($type == 'Male') echo 'checked="checked"'; ?>"> Male

OR

 <input type="radio" name="gender" value="<?php echo $gender ?>"/>Female

This one is right ??

i refer 2 links in SO but m not getting properly with radio button .... Suggestions always Welcome ...

Upvotes: 0

Views: 10208

Answers (1)

SeanWM
SeanWM

Reputation: 16989

The first one is correct:

<input type="radio" name="type" value="Male" <?php if ($type == 'Male') echo 'checked="checked"'; ?>"> Male

Upvotes: 1

Related Questions