title: php - How do i insert HTML table data into MySQL
body: <p>I have an HTML table with text and radio inputs that i want to insert each row into my MySQL table with PHP</p>
  
  <p>MySQL table looks like this:</p>
  
  <pre><code>================================
  |     Name      | Status | Ext |
  ================================
  </code></pre>
  
  <p>HTML table</p>
  
  <pre><code>===============================================================
  |     Name      | Present | Excused | Unexcused |     Ext     | 
  ===============================================================
  |  text input1  |    o    |    o    |     o     |  textarea   |
  ---------------------------------------------------------------
  |  text input2  |    o    |    o    |     o     |  textarea   |
  and so on...
  *o's are radios
  </code></pre>
  
  <p>it gets values from a MySQL query loop and i want it to be
  only one of the radios can be clicked and it sends the clicked one into the Status column</p>
  
  <p>Code</p>
  
  <pre><code> &lt;form method="post" action="insert.php" enctype="multipart/form-data"&gt;
      &lt;table&gt;
          &lt;tr&gt;
              &lt;th&gt;Name&lt;/th&gt;
              &lt;th&gt;Present&lt;/th&gt;
              &lt;th&gt;Excused&lt;/th&gt;
              &lt;th&gt;Unexcused&lt;/th&gt;
              &lt;th&gt;Ext&lt;/th&gt;
          &lt;/tr&gt;
          &lt;?php         
          echo "&lt;tr&gt;";
          $query = "select * from TbCard";
          $sql = mysqli_query($connect, $query);
              while ($data = mysqli_fetch_array($sql)) {
                  echo '&lt;tr&gt;';
                  echo"&lt;td&gt;&lt;input id='name' type='text' value='" . $data['Name'] . "' readonly style='border:none;width:350px'&gt;&lt;/input&gt;&lt;/td&gt;";
                  echo"&lt;td&gt;&lt;input type='radio'&gt;&lt;/td&gt;";
                  echo"&lt;td&gt;&lt;input type='radio'&gt;&lt;/td&gt;";
                  echo"&lt;td&gt;&lt;input type='radio'&gt;&lt;/td&gt;";
                  echo"&lt;td&gt;&lt;textarea&gt;&lt;/textarea&gt;&lt;/td&gt;";
                  echo '&lt;/tr&gt;';
              }
          }
          echo "&lt;/tr&gt;";
          ?&gt;
      &lt;/table&gt;
  &lt;input type="submit" value="Insert"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>EDIT: The table is in a form tag and has the action to another .php
  and i want a submit button to insert it</p>