title: Insert radio button value to mysql
body: <p>I have created a test form just to try to send my radio button value to mysql. I am having problems with it at the moment. The code below is just a test, I want the radio button to submit the value but it isn't.</p>
  
  <pre><code>    &lt;table width="300" border="0" align="center" cellpadding="0" cellspacing="1"&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;form name="form1" method="post" action="insert_ac.php"&gt;
  &lt;table width="100%" border="0" cellspacing="1" cellpadding="3"&gt;
  &lt;tr&gt;
  &lt;td colspan="3"&gt;&lt;strong&gt;TEST &lt;/strong&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td width="71"&gt;Name&lt;/td&gt;
  &lt;td width="6"&gt;:&lt;/td&gt;
  &lt;td width="301"&gt;&lt;input name="name" type="text" id="name"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;Case&lt;/td&gt;
  &lt;td&gt;:&lt;/td&gt;
  &lt;td&gt;&lt;input name="case" type="radio" id="case1"&gt; &lt;input name="case" type="radio" id="case2"&gt; &lt;input name="case" type="radio" id="case3"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;Email&lt;/td&gt;
  &lt;td&gt;:&lt;/td&gt;
  &lt;td&gt;&lt;input name="email" type="text" id="email"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td colspan="3" align="center"&gt;&lt;input type="submit" name="Submit" value="Submit"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/form&gt;
  &lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>And here is the connection part of the database</p>
  
  <pre><code>&lt;?php
  
  $host="localhost"; // Host name 
  $username="root"; // Mysql username 
  $password="123"; // Mysql password 
  $db_name="store"; // Database name 
  $tbl_name="test_mysql"; // Table name 
  
  // Connect to server and select database.
  mysql_connect("$host", "$username", "$password")or die("cannot connect"); 
  mysql_select_db("$db_name")or die("cannot select DB");
  
  // Get values from form 
  $name=$_POST['name'];
  $case=$_POST['case'];
  $email=$_POST['email'];
  
  // Insert data into mysql 
  $sql="INSERT INTO $tbl_name(name, case, email)VALUES('$name', '$case', '$email')";
  $result=mysql_query($sql);
  
  // if successfully insert data into database, displays message "Successful". 
  if($result){
  echo "Successful";
  echo "&lt;BR&gt;";
  echo "&lt;a href='insert.php'&gt;Back to main page&lt;/a&gt;";
  }
  
  else {
  echo "ERROR";
  }
  ?&gt; 
  
  &lt;?php 
  // close connection 
  mysql_close();
  ?&gt;
  </code></pre>