如何在 PHP 的列表视图中显示来自 MySQL 数据库的数据


how to display data from MySQL database in listview in php

大家好,我想在php中显示MySQL中的数据到列表视图。我正在用 php 创建一个分类广告网站。我只需要在列表视图中显示字段结果,例如

olx.com.pk/rawalpindi

您可以将<table><div>用于列表视图:

<table>
   <thead>
      <th></th>
      <th></th>
   </thead>
   <tbody>
   <?php
      $query = mysql_query();
      while($row = mysql_fetch_array($query)){
         echo "<tr>$row['index1']</tr>";
         echo "<tr>$row['index2']</tr>";
   ?>
   </tbody>
</table>