echo循环输出数据库内容表格 如何书写

WBOY
Release: 2016-06-23 13:37:07
Original
1638 people have browsed it

    
  $link=mysql_connect("localhost", "root","");
  $db  = mysql_select_db("ms_qua");
  $sql = "SELECT * FROM qua";
  $result = mysql_query($sql);    
  ?>  
  


表名:厂家资质信息


  

  
  
  
  
  
  
  
  
  
  
 
  while($row = mysql_fetch_array($result))
  {
    echo 
  }

?>
序号 部门 岗位 姓名 身份证号码 合同签订时间 证书名称 发证单位 证书编号 发证日期


如何echo输出表格 获取数据库内容?


回复讨论(解决方案)

echo "

";
echo "".XXXX."";
...........
echo "";



没写全,自己补全吧,另外,这里循环最好用foreach

while($row = mysql_fetch_row($result)){  echo '<tr>';  foreach($row as $v) echo "<td>$v</td>";  echo '</tr>';}
Copy after login

 
while($row = mysql_fetch_row($result))
{
  echo '

';
  foreach($row as $v) 
  echo "$v";
  echo '';
}
?>
在php里格式有误 输出不了 
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!