title: How can I join these two html tables together?
body: <p>I want to create a compare sort of page. I currently have two tables with the information, but want it to be on table or join both together. The first row would show Name of brand, second would show cost, etc... I am grabbing the values of selected checkboxs and based on what they selected it get compared.</p>
  
  <pre><code>$testName = $_POST['testCompare'];
  $rpl = str_replace("_", " ", $testName);
  $firstOne = "$rpl[0]";
  $secondOne = "$rpl[1]";
  echo "$firstOne";
  echo "&lt;br/&gt;";
  echo "$secondOne";
  
  $query = "SELECT * FROM test_table WHERE test_name = '$firstOne'";
  $query2 = "SELECT * FROM test_table WHERE test_name = '$secondOne'";
  $result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
  $result2 = mysql_query($query2) or die ("Error in query: $query2. " . mysql_error());
  
  if (mysql_num_rows($result) &gt; 0 &amp;&amp; mysql_num_rows($result2) &gt; 0) {
  
  //if (mysql_num_rows($result) &gt; 0) {
  
      while($row = mysql_fetch_row($result)) {            
          if ($firstOne == $row[1]) {
          {
              echo "&lt;table border=1&gt;";            
              echo "&lt;tr&gt;";
              echo "&lt;td&gt;" . $row[0] . "&lt;/td&gt;";
              echo "&lt;tr&gt;";
              echo "&lt;td&gt;" . $row[1] . "&lt;/td&gt;";
              echo "&lt;/tr&gt;";
              echo "&lt;tr&gt;";
              echo "&lt;td&gt;" . $row[2] . "&lt;/td&gt;";
              echo "&lt;/tr&gt;";
              echo "&lt;tr&gt;";
              echo "&lt;td&gt;" . $row[3] . "&lt;/td&gt;";
              echo "&lt;/tr&gt;";
              echo "&lt;tr&gt;";
              echo "&lt;td&gt;" . $row[4] . "&lt;/td&gt;";
              echo "&lt;/tr&gt;";
              }
          }
          }echo "&lt;/table&gt;";
  
      while($row2 = mysql_fetch_row($result2)) {          
          if ($secondOne == $row2[1]) {
          {   echo "&lt;table border=1&gt;";        
              echo "&lt;tr&gt;";
              echo "&lt;td&gt;" . $row2[0] . "&lt;/td&gt;";
              echo "&lt;/tr&gt;";
              echo "&lt;tr&gt;";
              echo "&lt;td&gt;" . $row2[1] . "&lt;/td&gt;";
              echo "&lt;/tr&gt;";
              echo "&lt;tr&gt;";
              echo "&lt;td&gt;" . $row2[2] . "&lt;/td&gt;";
              echo "&lt;/tr&gt;";
              echo "&lt;tr&gt;";
              echo "&lt;td&gt;" . $row2[3] . "&lt;/td&gt;";
              echo "&lt;/tr&gt;";
              echo "&lt;td&gt;" . $row2[4] . "&lt;/td&gt;";
              echo "&lt;/tr&gt;";
              }
          }
          }
          echo "&lt;/table&gt;";
      }
   else {
          echo "No Results";
      }[/CODE]
  </code></pre>
  
  <p>Thanks</p>