title: html/mysql echo query results into table?
body: <p>I am using the following MySQL query to select data from my database and echo the results in a table.</p>
  
  <p>My problem is the first set of results is being echoed correctly, however the next line is showing my results as vertical down the page rather than horizontal.</p>
  
  <p>Here's what's happening:</p>
  
  <pre><code>Heading1      Heading2      Heading3      Heading4     Heading5
  a             b             c             d            e
  a
  b
  c
  d
  e
  </code></pre>
  
  <p>Please can someone show me where I am going wrong. Here's my code:</p>
  
  <pre><code>    &lt;?php 
  $conn = new mysqli($host, $username, $password, $db_name);
  // Check connection
  if ($conn-&gt;connect_error) {
  die("Connection failed: " . $conn-&gt;connect_error); } 
  $sql = "select * from new_supplier_request where status!= 'complete' and action_taken ='actioned'";
              $result = $conn-&gt;query($sql);
              if ($result-&gt;num_rows &gt; 0) {
              echo '&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;p&gt;&lt;u&gt;Request By&lt;/u&gt;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;&lt;u&gt;Date&lt;/u&gt;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;&lt;u&gt;Status&lt;/u&gt;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;&lt;u&gt;Supplier Name&lt;/u&gt;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;p&gt;&lt;u&gt;Action&lt;/u&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;';
  
              while($row = $result-&gt;fetch_assoc()) { 
  
          $datetime = strtotime($row['date']);
          $mysqldate = date("D, d M Y ", $datetime);
  
          echo '&lt;tr&gt;';
          echo '&lt;td&gt;&lt;p&gt;'.$row['user_id'].'&lt;/p&gt;&lt;/td&gt;';
          echo '&lt;td&gt;&lt;p&gt;'.$row['user_id'].'&lt;/p&gt;&lt;/td&gt;';
          echo '&lt;td&gt;&lt;p&gt;'.$row['user_id'].'&lt;/p&gt;&lt;/td&gt;';
          echo '&lt;td&gt;&lt;p&gt;'.$row['user_id'].'&lt;/p&gt;&lt;/td&gt;';
          echo '&lt;td&gt;&lt;p&gt;&lt;a href="process/action.php?reference='.$row['reference'].'" id="action"&gt;Action&lt;/a&gt;&amp;nbsp;/&amp;nbsp;&lt;a href="process/decline.php?reference='.$row['reference'].'" id="decline"&gt;Decline&lt;/a&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;';
  }
  echo '&lt;/table&gt;';
  
              }else{
  
                  echo'&lt;div class="no_requests"&gt;No New Supplier Request&amp;#39;s&lt;/div&gt;';
  
  
              }  ?&gt;
  </code></pre>