title: Display data from mysql columns as rows in PHP
body: <p>Im trying to create a website to display a booking system's table.
  I have a table in mysql database which containing the data like this:<br></p>
  
  <p><a href="https://i.stack.imgur.com/6fwX5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6fwX5.png" alt="enter image description here"></a></p>
  
  <p>The second column is the post_id. The booking details are provided with the same post_id.</p>
  
  <p>I would like to create an html table which contains the same booking details in one row like this:
  <a href="https://i.stack.imgur.com/rk0Ic.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rk0Ic.png" alt="enter image description here"></a></p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;Booking&lt;/title&gt;
    &lt;style&gt;
      table {
        border-collapse: collapse;
        width: 100%;
        color: #588c7e;
        font-family: monospace;
        font-size: 25px;
        text-align: left;
      } 
      th {
        background-color: #588c7e;
        color: white;
      }
      tr:nth-child(even) {background-color: #f2f2f2}
    &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;table&gt;
      &lt;tr&gt;
        &lt;th&gt;Field14&lt;/th&gt; 
        &lt;th&gt;Field15&lt;/th&gt; 
        &lt;th&gt;Field16&lt;/th&gt;
      &lt;/tr&gt;
      &lt;?php
        $conn = mysqli_connect("localhost", "admin", "", "test");
        // Check connection
        if ($conn-&gt;connect_error) {
          die("Connection failed: " . $conn-&gt;connect_error);
        } 
        $sql = "SELECT _field_14, _field_15, _field_16 FROM booking";
        $result = $conn-&gt;query($sql);
  
      ?&gt;
    &lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>