title: Adding radio button values to MYSQL table using PHP
body: <p>I am using PHP/MYSQL to create a form that includes radio buttons. I am trying and add the value of checked radio buttons to a table within a database. At the minute I can't get anything to add to the database. The table is called assessment.</p>
  
  <p><strong><em>QUESTION1.PHP</em></strong></p>
  
  <pre><code>&lt;?php 
  include 'core/init.php';
  include 'includes/overall/overall_header.php';
  protect_page();
  include 'includes/menu.php';
  include 'includes/overall/navigate.php';
  include 'includes/widgets/loggedin.php';
  
  ?&gt;      
  
  &lt;h1&gt;Assessment&lt;/h1&gt;
  
  &lt;form action="save.php" method="post"&gt;
  
  &lt;p class="p1"&gt;
  Question 1&lt;/p&gt;
  &lt;p class="p4"&gt;
  Are you tall or short?&lt;/p&gt;
  
  &lt;p class="p3"&gt; 
  &lt;input type="radio" name="q1" value="1" /&gt;
  1
  &lt;input type="radio" name="q1" value="2" /&gt;
  2
  &lt;input type="radio" name="q1" value="3" /&gt;
  3
  &lt;input type="radio" name="q1" value="4" /&gt;
  4
  &lt;input type="radio" name="q1" value="5" /&gt;
  5
  &lt;/p&gt;&lt;br&gt;&lt;br&gt;
  &lt;/form&gt;
  
  &lt;img src="Images/image1.png" alt="Submit" class="thumbnail" align="right" width="58"      height="52" id="question2"&gt;
  &lt;img src="Images/save.png" alt="Submit" class="thumbnail" align="right" width="65" height="52"&gt;
  
  &lt;?php
  }
   include 'includes/overall/overall_footer.php'; 
   ?&gt;  
  </code></pre>
  
  <p><strong><em>SAVE.PHP</em></strong></p>
  
  <pre><code>&lt;?php
  session_start();
  include('connection.php');
  $q1=$_POST['q1'];
  mysql_query("INSERT INTO `assessment` (q1) VALUES ('$q1')");
  header("location: question2.php?");
  mysql_close($con);
  ?&gt;
  </code></pre>