title: Getting radio button value and storing in php
body: <p>this is radio button code 
  now what if radio button does not have a constant name  how would i store the data in database because to  store the data in database we will need a name of form attribute</p>
  
  <pre><code>$sql1="select * from questions where email='". $_SESSION['email']    ."'";
   $row=mysqli_query($conn,$sql1);
  
   while ($result = mysqli_fetch_array($row))
  {
   ?&gt;
  
  &lt;h2 id="question_&lt;?php echo $result['qid'];?&gt;"&gt;&lt;?php echo   $result['qid'].".".$result['question'];?&gt;&lt;/h2&gt;
  
   &lt;input type="radio" value="&lt;?php echo $result['answer1'];?&gt;"  name="&lt;?php echo $result['qid'];?&gt;"&gt;&lt;?php echo $result['answer1'];?&gt;
  &lt;input type="radio" value="&lt;?php echo $result['answer2'];?&gt;"  name="&lt;?php echo $result['qid'];?&gt;"&gt;&lt;?php echo $result['answer2'];?&gt;
  
  &lt;input type="radio" value="&lt;?php echo $result['answer3'];?&gt;"  name="&lt;?php echo $result['qid'];?&gt;"&gt;&lt;?php echo $result['answer3'];?&gt;
  
    &lt;input type="radio" value="&lt;?php echo $result['answer4'];?&gt;"  name="&lt;?php echo $result['qid'];?&gt;"&gt;&lt;?php echo $result['answer4'];?&gt;
  </code></pre>
  
  <p>if we know the name of radio button we can access it using</p>
  
  <pre><code>&lt;input type="radio" value="&lt;?php echo $result['answer4'];?&gt;"  name="name"&gt;&lt;?php echo $result['answer4'];?&gt;
   $name=$_POST['name'];
  </code></pre>
  
  <p>but in the above code name of radio button is not fixed.questions is the table which consists of qid and questions with multiple options that is answer1,answer2 etc</p>
  
  <p>i want to store the option select by user into database.for which i need to know the name of radio button
  how should i use post in this case</p>
  
  <pre><code>$name=$_POST['what should go in here'];
  </code></pre>