您现在的位置: 无忧电子商务网 >> 信息学院 >> 程序开发 >> php >> 正文

一个在PHP中利用递归实现论坛分级显示的例子

作者:佚名    信息学院来源:整理    点击数:    更新时间:2008-2-2 我要参与讨论

 


<?php
/*存放帖子的表结构
create table announce (
 announce_id int(11) not null auto_increment,
 board_id smallint(6) not null,
 title varchar(100) not null,
 content tinytext,
 add_time datetime default '0000-00-00 00:00:00' not null,
 auth_name varchar(20) not null,
 auth_mail varchar(40),
 hit_count smallint(6) not null,
 bytes mediumint(9) not null,
 parent_id tinyint(4) not null,
 auth_ip varchar(15) not null,
 top_id int(11) not null,
 return_count tinyint(4) not null,
 face char(3) not null,
 primary key (announce_id),
 key board_id (board_id),
 key top_id (top_id)
);
*/

function show_announce($id,$self_id){
global $dbconnect;
global $board_id;
$query="select * from announce where announce_id='$id'";
$result=mysql_query($query,$dbconnect);
$myrow=mysql_fetch_array($result);
mysql_free_result($result);
echo "<li>\n";
echo "<img src='images/mood".$myrow[face].".gif'> ";
if($self_id!=$id)
echo "<a href='show.php3?board_id=$board_id&announce_id=$myrow[announce_id]&top_id=$myrow[top_id]'>";
echo $myrow[title];
if($self_id!=$id)
echo "</a>";
echo " - <strong>【".$myrow[auth_name]."】</strong>

[1] [2] 下一页

在google里搜索更多一个在PHP中利用递归实现论坛分级显示的例子

Google
Web www.51ec.org
  • 上一篇信息学院:

  • 下一篇信息学院:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    我来说两句 对此文章发表了评论
      昵 称: *必填    ·注册用户·
      评 分: 1分 2分 3分 4分 5分     严禁发表危害国家安全、政治、黄色淫秽等内容的评论,用户需对自己在使用本网站服务过程中的行为承担法律责任。本站管理员有权保留或删除评论内容,评论内容只代表机友个人观点,与本网站立场无关。  
    评 论
    内 容

     
    评论列表 (最新 评论仅限网友观点!)

    供求信息




    | 设为首页 | 加入收藏 | 关于我们 | 广告服务 | 联系方式 | 友情链接 | 版权申明