您现在的位置: 军旅同心 >> 读书赏析 >> 学习园地 >> 电脑网络 >> 技术文章 >> 文章正文
社区(php&&mysql)二
作者:采集员 文章来源:来源于网络 点击数: 更新时间:2005-9-10 14:35:48
nbsp;   $qsql="SELECT id from bbs_area";
          $rs=mysql_db_query($sql['db'],$qsql);
          $row=mysql_fetch_array($rs);
          $aid=$row['id'];               
        }
    if(!$sid) {
        $qsql="SELECT id from bbs_subj where aid=$aid order by wdate DESC";
        $rs=mysql_db_query($sql['db'],$qsql);
        $row=mysql_fetch_array($rs);
        $sid=$row['id'];     
    }     
     
    if(!$pgno) {//????计
        //$pgno=0;  
        $items=0;
        $qsql="SELECT id from bbs_subj where aid=$aid order by wdate DESC";
        $rs=mysql_db_query($sql['db'],$qsql);
        while($row=mysql_fetch_array($rs)){
            $id=$row['id'];     
            if($id==$sid) break;
            $items++;
        }
        $pgno=(INT)($items/$showitems);         
    }
     
    //============================================================
    $qsql="SELECT * from bbs_area where id=$aid ";
    $rs=mysql_db_query($sql['db'],$qsql);
    $row=mysql_fetch_array($rs);
    $banner=$row['banner'];
    $body=$row['body'];
    $master=$row['master'];
    echo "<center><font color=GREEN size=5><b>$banner</b></font></center>";
     
    echo "<FORM  name=mtab  ENCTYPE=multipart/form-data METHOD=POST ACTION=$PHP_SELF?proc=search>";
    echo "<TABLE width=85% border=0 cellPadding=0 cellSpacing=1 align=center class='tablefont'>";
      echo "<tr><td>";
           
              echo "<input type='hidden' name=aid value='$aid'>";     
              echo "??ゅ彻:";
              echo "<INPUT TYPE='TEXT' NAME='key' size=25 class='tablefont'>";
              echo "<INPUT TYPE='Submit'value='?高' class='tablefont'>";
           
      echo "</td></tr>";
    echo "</table>";  
    echo "</FORM>";  
     
    $qsql="SELECT * from bbs_subj where aid=$aid order by wdate DESC";
    $rs=mysql_db_query($sql['db'],$qsql);
    $all=mysql_num_rows($rs);  //how rows
    $pages=(INT)($all/$showitems); // how pages
    $pgcount=$pgno*$showitems;
    if($pgcount > $all) {  
        $pgno=$pages-1; // Page point over all pages
        $pgcount=$pgno*$showitems;
     }
    mysql_data_seek($rs, $pgcount);
    $cnt=0;
    pagebar($pages);
    echo "<TABLE width=85% border=0 cellPadding=0 cellSpacing=1 align=center bgcolor='#6CA6CD'>";
      echo "<tr><td>";
      echo "<TABLE width=100% cellPadding=1 cellSpacing=1 bgcolor=white class='tablefont'>";
        echo "<tr bgcolor=#F1E1FF>";
            echo "<th >夹?</th>";
            echo "<th>???</th>";
            echo "<th width=30>?莱</th>";
            echo "<th width=30>??</th>";
            echo "<th width=70>ら戳</th>";
        echo "</tr>";
        while($row=mysql_fetch_array($rs)) {
            if(++$cnt > $showitems) break;
            $id=$row['id'];
            $banner=$row['banner'];
            $poster=$row['poster'];
            $views=$row['views'];
            $wdate=sdatetime($row['wdate']);
            $docs=reAnum($id);
            echo "<tr bgcolor='#F0F8FF'>";
                echo "<td>";
                    echo "<a href=$PHP_SELF?proc=view&aid=$aid&sid=$id&rid=$id>";
                        if($sid==$id) echo "<font color=red>〈$banner</font>";
                        else echo $banner;
                    echo "</a>";
                echo "</td>";
                echo "<td>";
                    echo $poster;
                echo "</td>";
                echo "<td class='num'>";
                    echo $docs;
                echo "</td>";
                echo "<td class='num'>";
                    echo $views;
                echo "</td>";
                echo "<td class='num'>";
                    echo $wdate;
                echo "</td>";
            echo "</tr>";
            if($OPEN_LIST) openlist($id);
        }
      echo "</td></tr></table>";
    echo&qu

上一页  [1] [2] [3] 下一页


 
免责声明:作品版权归所属媒体与作者所有!!本站刊载此文不代表同意其说法或描述,仅为提供更多信息。如果您认为我们侵犯了您的版权,请告知!本站立即删除。有异议请联系我们。
文章录入:烟灰缸    责任编辑:烟灰缸 
  • 上一篇文章:
  • 下一篇文章:
  • 网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    | 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 | 网站公告 | 管理登录 |