Creating a table in HTML using data from MySQL Database not working
<p>I am trying to display a table on a webpage from MySQL database, but it's now working! Here's my code:</p>

<pre><code>&lt;?php 
    function list_schools() {
       $conn = mysqli_connect("localhost", "root", "", "Database_Project");
       if ($conn === false) {
          die("Could not connect:"  . mysqli_connect_error()); 
       } 

       $output = "";
       $result = mysqli_query($conn, "SELECT school_id, name, address, phone_number, email, type FROM Schools;") or die('cannot show tables');       
       while ($row = mysqli_fetch_array($result)){
          $output .= '
          &lt;tr&gt;
          &lt;td&gt;' . $row['school_id'] . '&lt;/td&gt;
          &lt;td&gt;' . $row['name'] . '&lt;/td&gt;                                                   
          &lt;td&gt;' . $row['address'] . '&lt;/td&gt;
          &lt;td&gt;' . $row['phone_number'] . '&lt;/td&gt;
          &lt;td&gt;' . $row['email'] . '&lt;/td&gt; 
          &lt;td&gt;' . $row['type'] . '&lt;/td&gt;                                    
          &lt;/tr&gt;';
       }
       return $output;

    }

    $exec_func = list_schools();
?&gt;

&lt;table cellpadding="0" cellspacing="0" width="100%" class="sortable"&gt;
    &lt;thead&gt;
       &lt;tr&gt;
          &lt;th&gt;ID&lt;/th&gt;
          &lt;th&gt;Name&lt;/th&gt;
          &lt;th&gt;Address&lt;/th&gt;
          &lt;th&gt;Phone Number&lt;/th&gt;
          &lt;th&gt;Email&lt;/th&gt;
          &lt;th&gt;Type&lt;/th&gt;
          &lt;td&gt;&amp;nbsp;&lt;/td&gt;
       &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
       &lt;?php echo exec_func; ?&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
</code></pre>

<p>Whenever I try displaying it on my browser I get the following:</p>

<p>1</p>

<p>cannot show columns from 1</p>

<p>What am I doing wrong?</p>