title: how to insert data from mysql into html and vice versa, having radio button while inside a while loop
body: <p>how can I insert data into mysql using radio button while inside the while loop.my code is something like this. </p>
  
  <pre><code>&lt;form&gt;&lt;table&gt;
      &lt;?php
      $sql = mysql_query("SELECT * FROM table WHERE id='$id'");
      while ($row=mysql_fetch_array($sql)) {
      ?&gt;
  
         &lt;tr&gt;&lt;td&gt;
         &lt;input type='radio' name ="select[]" value=&lt;?php echo $row['tid'] ?&gt; /&gt;&lt;/td&gt;
         &lt;td&gt;&lt;input type="text" name="name"/&gt;&lt;/td&gt;
         &lt;td&gt;&lt;input type="text" name="age"/&gt;&lt;/td&gt;
         &lt;/tr&gt; 
      &lt;?php
      }
      ?&gt;
      &lt;tr&gt;&lt;td&gt;&lt;input type="submit"&gt;&lt;/td&gt;&lt;/tr&gt;
      &lt;/table&gt;&lt;/form&gt;
  
  
  
       if(isset($_POST['submit'])){
  for($i=0;$i&lt;count($select);$i++){
          $query = mysql_query("INSERT INTO disasterTbl (field, field2, field3) VALUES('$radioButton_value here', '$value', $value)")or die(mysql_error());
  
          }
  }
  </code></pre>
  
  <p>please help thanks. </p>