title: How to store combo box and radio button values to mysql database using php script?
body: <p>I'm trying to insert data into mysql database using php script. <strong>I have inserted text box values like: fname, lname, email and pwd.</strong>
  In this case I have 2 problems. The First one is I can't to assign for variable and store the combo box and radio button values.
  The Second one is how can to store the apart values of combo box into one like: Month, Day and Year into the database. How can I do that?
  My <strong>Database</strong> attributes are: "<strong>fname, lname, userpasswd, username, bdate, sex</strong>"
  Thanks!</p>
  
  <p>This is snapshot of my Registration Form</p>
  
  <pre><code>  &lt;form name="signup" action="actions/registeruser.php" method="POST" onsubmit="return validate()"&gt;
      &lt;input type="text" placeholder="First Name" name="fname"&gt;
      &lt;input type="text" placeholder="Last Name" name="lname"&gt;
      &lt;input type="text" placeholder="Your Email" maxlength="30" size="45" name="email"&gt;
      &lt;input type="password" placeholder="password" maxlength="15" size="45" name="pwd"&gt;
      &lt;select name="month" size=""&gt;
          &lt;option&gt;Month&lt;/option&gt;
          &lt;option&gt;jan&lt;/option&gt;
          &lt;option&gt;feb&lt;/option&gt;
          &lt;option&gt;mar&lt;/option&gt;
      &lt;/select&gt;
      &lt;select name="Day" size=""&gt;
          &lt;option&gt;Day&lt;/option&gt;
          &lt;option&gt;1&lt;/option&gt;
          &lt;option&gt;2&lt;/option&gt;
          &lt;option&gt;3&lt;/option&gt;
      &lt;/select&gt;
      &lt;select name="Year" size=""&gt;
          &lt;option&gt;Year&lt;/option&gt;
          &lt;option&gt;2013&lt;/option&gt;
          &lt;option&gt;2012&lt;/option&gt;
          &lt;option&gt;2011&lt;/option&gt;
      &lt;/select&gt;&lt;br /&gt;&lt;br /&gt;
      &lt;input type="radio" name="sex" checked="checked"&gt;Male
      &lt;input type="radio" name="sex" &gt;Female
      &lt;input type="submit" value="Sin Up" &gt;
      &lt;/form&gt;&lt;hr width="2"&gt;
  </code></pre>
  
  <p>This is snapshot of the 'registeruser.php' file</p>
  
  <pre><code>&lt;?php
      session_start();
  
  $dbhost="localhost";
  $dbuser="root";
  $dbpass="";
  $tablename="users";
  //connect the server &amp; select database
  $conn=mysql_connect($dbhost, $dbuser, $dbpass)or die("cannor connect");
  mysql_select_db('fb')or die("cannort select DB");
  
  // user details sent from FORM
      $fname=$_POST['fname'];
      $lname=$_POST['lname'];
      $password=$_POST['pwd'];
      $mail=$_POST['email'];
  //Register Students 
  $sql="INSERT INTO $tablename(fname, lname, userpasswd, usermail)values('$fname','$lname', '$password','$mail')";
  $result=mysql_query($sql);
  
      if($result){
      echo "&lt;font size='+1' color='blue'&gt; $fname, Successfully Registered.&lt;/font&gt;";
  
      }
      else
      {
  
      echo "&lt;font size='+1' color='red'&gt;Registration Failed.&lt;/font&gt;"; 
  
      }
  ?&gt;
  </code></pre>