文件名:list.php

说明:mysql_fetch_array()

mysql_fetch_array(data,array_type)函数从结果集中取得一行作为关联数组,或数字数组,或二者兼有
返回根据从结果集取得的行生成的数组,如果没有更多行则返回 false。

data      可选。规定规定要使用的数据指针。该数据指针是 mysql_query() 函数产生的结果。

array_type  可选。规定返回哪种结果。可能的值:MYSQL_ASSOC - 关联数组;MYSQL_NUM - 数字数组;MYSQL_BOTH - 默认。同时产生关联和数字数组

<?php
 include("conn.php");

 include("head.php");
  $SQL="SELECT * FROM `message` order by id desc";
  $query=mysql_query($SQL);
  while($row=mysql_fetch_array($query)){
?>

<table width=500 border="0" cellpadding="5" cellspacing="1" bgcolor="#add3ef">
  <tr bgcolor="#eff3ff">
  <td>标题:<?=$row[title]?> 用户:<?=$row[user]?></td>
  </tr>
  <tr bgColor="#ffffff">
  <td>内容:<?
 echo htmtocode($row[content]);
   ?></td>
  </tr>
</table>
<?
  }
?>

相关文章:

  • 2021-12-29
  • 2022-01-08
  • 2022-12-23
  • 2021-08-15
  • 2021-11-12
  • 2022-12-23
  • 2021-12-10
  • 2021-11-30
猜你喜欢
  • 2022-12-23
  • 2021-12-19
  • 2021-11-30
  • 2021-09-26
  • 2021-05-28
  • 2022-12-23
相关资源
相似解决方案