title: How to create HTML table from multiple inputs from user?
body: <p>I have created simple <code>html</code> form which has two major inputs:</p>
  
  <ol>
  <li>Checkbox for multiple choices (for info: user can select multiple districts)</li>
  <li>radio button for single input  (for info: user after marking the checkbox in step one will now chose another only one input)
  after this Table should be generated: </li>
  </ol>
  
  <p><strong>Note:</strong> Multiple tables have same column name so that the displayed table will include the merged data for selected district names</p>
  
  <p>Till now, I have created table for only one district i.e. for individual district. (my database resides in PostgreSQL) </p>
  
  <p>This is <strong>database connection</strong> for my Table:</p>
  
  <pre><code>$db = pg_connect('host=localhost port=5433 dbname=MergedDB user=postgres password=admin'); 
  </code></pre>
  
  <p>I have <strong>two array</strong> for my table:-</p>
  
  <pre><code>$userclass = array('0-5','6-10','11-15', '&gt;15','Total');
    $btotal = array();
  </code></pre>
  
  <p>The <strong>query fetching</strong> code is:-</p>
  
  <pre><code>$query = " select * from "Arscenic_Test" 
  .
  .
  .
  /* some query here*/";
  
  $btresult = pg_query($db, $query);
  while($btresults = pg_fetch_row($btresult)){
          $count = count($btresults);
          $y = 0;
          while ($y &lt; $count)
          {
              $c_row = current($btresults);
              $btotal[] = $c_row;
              next($btresults);
              $y = $y + 1;
          }
      }
  </code></pre>
  
  <p>And my <strong>HTML table</strong> is:-</p>
  
  <pre><code>&lt;?php 
      for($i=0; $i&lt;5; $i++){
  ?&gt;
  &lt;tr&gt;
      &lt;td&gt;&lt;?php echo $userclass[$i];?&gt;&lt;/td&gt;
      &lt;td&gt;&lt;?php echo $btotal[$i];?&gt;&lt;/td&gt;
      &lt;td&gt;&lt;?php echo $perb10[$i];?&gt;&lt;/td&gt;
      &lt;td&gt;&lt;?php echo $bettotal[$i];?&gt;&lt;/td&gt;
      &lt;td&gt;&lt;?php echo $pbet[$i];?&gt;&lt;/td&gt;
      &lt;td&gt;&lt;?php echo $b51_100total[$i];?&gt;&lt;/td&gt;
      &lt;td&gt;&lt;?php echo $pb51_100[$i];?&gt;&lt;/td&gt;
      &lt;td&gt;&lt;?php echo $bt101_300total[$i];?&gt;&lt;/td&gt;
      &lt;td&gt;&lt;?php echo $pb101_300[$i];?&gt;&lt;/td&gt;
      &lt;td&gt;&lt;?php echo $abov300total[$i];?&gt;&lt;/td&gt;
      &lt;td&gt;&lt;?php echo $pabov300[$i];?&gt;&lt;/td&gt;
      &lt;td&gt;&lt;?php echo $total[$i];?&gt;&lt;/td&gt;
      &lt;td&gt;&lt;?php echo $ptotal[$i];?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>How to give User a multiple choices and generate the table as per his inputs?</p>