日期:2013-12-08  浏览次数:20533 次

现将本人的实践结果show给大家,不足之处就是分页的方法不太好,不能显示具体的页数,可实在又没有其它更好的解决办法,只好先如此了,如果哪位有类似本论坛的分页方法,表赐教一二,二泉不胜感激!具体可访问我的个人小网站:http://web.nyist.net/~wbgwrq,不废话了,开始吧......

//表的结构如下:
//creat.sql
//简单说明:RootId 论题序数;Layer:帖子层次,缩进的依据;Orders:帖子的顺序
CREATE TABLE over_post (
  id int(11) NOT NULL auto_increment,
  title varchar(80) NOT NULL default '',
  content text,
  postat datetime NOT NULL default '0000-00-00 00:00:00',
  readed int(11) NOT NULL default '0',
  size int(11) NOT NULL default '0',
  rootid int(11) NOT NULL default '0',
  orders int(4) NOT NULL default '0',
  layer int(4) NOT NULL default '0',
  PRIMARY KEY  (id)
) TYPE=MyISAM;
//creat.sql End

//发表根帖,即RootId,Layer,Orders为0的帖子
//said.php
//begin
<form method="post" action="post.php">
  <table width="81%" border="0" cellspacing="1" cellpadding="0" align="center">
    <tr bgcolor="#66CCCC">
      <td height="35" width="23%">
        <div align="right">你的想法:
        </div>
      </td>
      <td height="35" width="77%">
        <input type="text" name="title" size="50" class="eq">
      </td>
    </tr>
    <tr bgcolor="#66CCCC">
      <td height="39" width="23%">
        <div align="right">你的内容:
        </div>
      </td>
      <td height="39" width="77%">
        <textarea name="content" cols="50" rows="10" class="eq"></textarea>
      </td>
    </tr>
    <tr bgcolor="#66CCCC">
      <td colspan="2" height="24">
      </td>
    </tr>
    <tr bgcolor="#66CCCC">
      <td colspan="2" height="28">
        <div align="center">
          <input type="submit" name="said" value="先说这些">
          <input type="reset" name="Submit2" value="从头再来">
        </div>
      </td>
    </tr>
  </table>
  </form>
//said.php End


//帖子内容,且在本页进行跟帖
//content.php
//Begin
<?php

$result=mysql_query("select

over_post.title,over_post.content,over_post.postat,over_post.readed,over_post.rootid,over_post.la

yer,over_post.orders from over_post where over_post.id=$id");
$readed=mysql_result($result,0,"readed");
$title=mysql_result($re