Mysql
 sql >> Datenbank >  >> RDS >> Mysql

php-Ausgabe von MySQL in die HTML-Tabelle

Ersetzen Sie das while innerhalb des if durch Folgendes:

echo '<table class="table table-striped table-bordered table-hover">'; 
echo "<tr><th>Name</th><th>Description:</th><th>Status</th></tr>"; 
while($row = mysqli_fetch_array($results))
{
  echo "<tr><td>"; 
  echo $row['name'];
  echo "</td><td>";   
  echo $row['des'];
  echo "</td><td>";    
  echo $row['status'];
  echo "</td></tr>";  
}
echo "</table>";