title: Populate HTML Table with database values
body: <p>I have a table that contains city, person, employment_status. I want to populate my html table with this values using PHP, the first <code>td</code> will contain a city the next will contain the total number of people in that city and the third <code>td</code> will contain the total number of people employed. Normally I populate my table using while but this one I don't know how to go about the mysqli query and if while will also work, checked for a solution but can't find, been stuck here for days.</p>
  
  <pre><code>                                      &lt;table class="table table-striped table-advance table-hover search-table" &gt;
                           &lt;tbody&gt;
                         &lt;thead&gt;
                            &lt;tr&gt;
                               &lt;th&gt;&lt;i class="icon_profile"&gt;&lt;/i&gt; city&lt;/th&gt;
                               &lt;th&gt;&lt;i class="icon_pin_alt"&gt;&lt;/i&gt; Total number of people&lt;/th&gt;
                               &lt;th&gt;&lt;i class="icon_pin_alt"&gt;&lt;/i&gt; no of pepople employed&lt;/th&gt;
  
                            &lt;/tr&gt;
                            &lt;/thead&gt;
  
                             &lt;?php
              $sql = "SELECT COUNT(DISTINCT city) FROM user"; 
              $q=$conn-&gt;query($sql);
             while ($row = mysqli_fetch_array($q)) {
  </code></pre>
  
  <p>am stuck here, the query part of it, there is no row created in db to provide me this values</p>