title: Use Buttons In Table - PHP
body: <p>I'm following through a tutorial from a book I have but want to add some extra columns to a table. I have added the columns, buy and sell, and in each of those I want to display a button. I am unsure of how to do this, is it possible?</p>
  
  <p>Here's my code from the page with the table:</p>
  
  <pre><code>&lt;?php // Example 21-9: members.php
  include_once 'header.php';
  
  if (!$loggedin) die();
  
  echo "&lt;div class='main'&gt;";
  
  $con=mysqli_connect("localhost","root","usbw","stocktrading");
  // Check connection
  if (mysqli_connect_errno()) {
      echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
  
  $result = mysqli_query($con,"SELECT * FROM stocks");
  
  echo "&lt;table border='1  '&gt;
  &lt;tr&gt;
  &lt;th&gt;ID&lt;/th&gt;
  &lt;th&gt;Name&lt;/th&gt;
  &lt;th&gt;Price&lt;/th&gt;
  &lt;th&gt;Buy&lt;/th&gt;
  &lt;th&gt;Sell&lt;/th&gt;
  &lt;/tr&gt;";
  
  while($row = mysqli_fetch_array($result)) {
      echo "&lt;tr&gt;";
      echo "&lt;td&gt;" . $row['id'] . "&lt;/td&gt;";
      echo "&lt;td&gt;" . $row['name'] . "&lt;/td&gt;";
      echo "&lt;td&gt;" . $row['price'] . "&lt;/td&gt;";
      echo "&lt;/tr&gt;";
  }
  echo "&lt;/table&gt;";
  
  mysqli_close($con);
  ?&gt;
  </code></pre>