I have a table that contains city, person, employment_status. I want to populate my html table with this values using PHP, the first td
will contain a city the next will contain the total number of people in that city and the third td
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.
<table class="table table-striped table-advance table-hover search-table" >
<tbody>
<thead>
<tr>
<th><i class="icon_profile"></i> city</th>
<th><i class="icon_pin_alt"></i> Total number of people</th>
<th><i class="icon_pin_alt"></i> no of pepople employed</th>
</tr>
</thead>
<?php
$sql = "SELECT COUNT(DISTINCT city) FROM user";
$q=$conn->query($sql);
while ($row = mysqli_fetch_array($q)) {
am stuck here, the query part of it, there is no row created in db to provide me this values
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…