title: PHP: Show table of results from database
body: <p>I have this simple bit of PHP that should be showing a table of invites:</p>
  
  <pre><code>    // connect to the database
  
      $host = '###';
      $username = '###';
      $pass = '###';
  
      mysql_connect($host,$username,$pass);
      mysql_select_db("###");
  
      // select everything from the news table
  
      $query = "SELECT * FROM creathive_applications";
      $result = mysql_query($query);
  
      echo "&lt;table&gt;";
      echo "&lt;tr&gt;";
  
      while( ($row = mysql_fetch_array($result)))
      {
          echo "&lt;td&gt;".$row['firstname']."&lt;/td&gt;";
          echo "&lt;td&gt;".$row['lastname']."&lt;/td&gt;";
          echo "&lt;td&gt;".$row['email']."&lt;/td&gt;";
          echo "&lt;td&gt;".$row['url']."&lt;/td&gt;";
      }
  
      echo "&lt;/tr&gt;";
      echo "&lt;/table&gt;";
  
      // disconnect from the database
  
      mysql_close();
  </code></pre>
  
  <p>However it's not working? Any ideas why and how to find out. THANKS :)</p>
  
  <p><strong>Just to confirm, the <code>&lt;table&gt;</code> and <code>&lt;tr&gt;</code> are being outputted and the table name is <code>creathive_applications</code> with a H</strong></p>