WEB开发网
开发学院WEB开发PHP 社区(php&&mysql)三 阅读

社区(php&&mysql)三

 2008-02-15 18:00:13 来源:WEB开发网   
核心提示:function prev_subj($id){ $DROOT=getenv('DOCUMENT_ROOT'); include("sql.php3"); $db=MySQL(和PHP搭配之最佳组合)_connect($sql['ho
function prev_subj($id){
  $DROOT=getenv('DOCUMENT_ROOT');
  include("sql.php3");
  $db=MySQL(和PHP搭配之最佳组合)_connect($sql['host'], $sql['user'] , $sql['passwd']); 
  $qstr="select id,aid from bbs_subj where id='$id'";
  $rs=MySQL(和PHP搭配之最佳组合)_db_query($sql['db'],$qstr);   
  $row=MySQL(和PHP搭配之最佳组合)_fetch_array($rs);
  $aid=$row['aid'];
   
  $qstr="select id from bbs_subj where aid='$aid' order by wdate DESC";
  $rs=MySQL(和PHP搭配之最佳组合)_db_query($sql['db'],$qstr);
  $pid=$id;   
  while($row=MySQL(和PHP搭配之最佳组合)_fetch_array($rs)){
    $tid=$row['id'];   
    if($id==$tid) break;
    $pid=$tid;
  }
   
  return $pid;
}
// 绞
function next_subj($id){
  $DROOT=getenv('DOCUMENT_ROOT');
  include("sql.php3");
  $db=MySQL(和PHP搭配之最佳组合)_connect($sql['host'], $sql['user'] , $sql['passwd']); 
  $qstr="select id,aid from bbs_subj where id='$id'";
  $rs=MySQL(和PHP搭配之最佳组合)_db_query($sql['db'],$qstr);   
  $row=MySQL(和PHP搭配之最佳组合)_fetch_array($rs);
  $aid=$row['aid'];
   
  $qstr="select id from bbs_subj where aid='$aid' order by wdate DESC";
  $rs=MySQL(和PHP搭配之最佳组合)_db_query($sql['db'],$qstr);
  $pid=$id;   
  while($row=MySQL(和PHP搭配之最佳组合)_fetch_array($rs)){
    $pid=$row['id'];   
    if($id==$pid) break;
  }
  if($row=MySQL(和PHP搭配之最佳组合)_fetch_array($rs)) {
    $pid=$row['id'];
  }
  return $pid;
}

//======================================================================
function viewbar() {
  global $pgno;
  global $PHP_SELF;
  global $aid,$sid;
  //global $OPEN_LIST;
  echo "<TABLE width=85% border=0 cellPadding=0 cellSpacing=1 align=center align=center class='num'>";
  echo "<tr><td align=center>";
    $nextid=next_subj($sid);
    $previd=prev_subj($sid);
    echo "<a href=$PHP_SELF?aid=$aid&sid=$sid>[夹肈跋]</a>";
    echo "<a href=#re>[莱セ绞]</a>";

共7页 1 2 3 4 5 6 7

Tags:社区 php mysql

编辑录入:coldstar [复制链接] [打 印]
赞助商链接