<?php
$db=new MySQLi("localhost","账号","密码","数据库名");   //链接数据库
$sql=$db->query("select * from 表名");   //执行SQL语句查询
$arrt=$sql->fetch_all();
 echo"<table border='1' width='100%'>";
 $attr=array(要输出的列数,要输出的列数,要输出的列数);
foreach($arrt as $v)   //遍历数组
{
    
      echo "<tr>";
      foreach($attr as $q)
      {
      echo"<td>$v[$q]</td> ";
      }
      echo"</tr>"; 
}

echo "</table>";
?>

 

相关文章:

  • 2022-12-23
  • 2021-12-01
  • 2021-10-12
  • 2022-12-23
  • 2021-08-21
  • 2022-12-23
  • 2021-09-12
猜你喜欢
  • 2021-09-29
  • 2022-12-23
  • 2021-10-01
  • 2022-12-23
  • 2023-03-20
  • 2022-01-17
相关资源
相似解决方案