title: PHP - How to update data to MySQL when click a radio button
body: <p>Example to save gender</p>
  
  <pre><code>&lt;form action="save.php?id=&lt;?=$id?&gt;" method="post"&gt;
      &lt;p&gt;&lt;label&gt;&lt;input name="gender" type="radio" value="male" &lt;?php if($gender=='male'){?&gt;checked="checked"&lt;? }?&gt; /&gt; Male&lt;/label&gt;&lt;/p&gt;
      &lt;p&gt;&lt;label&gt;&lt;input name="gender" type="radio" value="female" &lt;?php if($gender=='female'){?&gt;checked="checked"&lt;? }?&gt; /&gt; Female&lt;/label&gt;&lt;/p&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Here an example to update the value </p>
  
  <pre><code>  if ($_REQUEST['gender']) {
    mysql_query("UPDATE users SET gender='$gender' WHERE id='" . $id . "'") or die(mysql_error());
    }
  </code></pre>
  
  <p>How to make when we click on the gender the value will auto save to the db. Let me know.</p>