Home > Backend Development > PHP Tutorial > BBS (php & mysql) full version (3)_PHP tutorial

BBS (php & mysql) full version (3)_PHP tutorial

WBOY
Release: 2016-07-21 16:05:26
Original
988 people have browsed it

//此页面为php3.php
include "signup/mysql.inc";
switch($part){
case "1" :$table="bbs_php";break;
case "2" :$table="bbs_mysql";break;
case "3" :$table="bbs_html";break;
case "4" :$table="bbs_js";
}
//echo $part;
?>



xiaoyang















  




  
  
      
      
      
      
      
    


$sql="select * from ".$table." order by row DESC";
$result=mysql_query($sql)or die(mysql_error());
$row1=mysql_num_rows($result);



$row_max_page=12; //分页计算
$page=ceil($row1/$row_max_page);
$left_row=$row1-$p*$row_max_page;
$pre_left_row=$left_row+12;
$start_row=$left_row+$row_max_page+1;
if($left_row<=0)
{
$start_row=$pre_left_row+1;
$left_row=0;
}



$sql="select * from ".$table." where row<'$start_row' and row>'$left_row' order by row DESC";
    $result=mysql_query($sql)or die(mysql_error());

    while($row=mysql_fetch_array($result)){

       static $i=0;
       $i++;
       if($i%2)
        $color="CCCCFF";
       else $color="FFCCFF";
    echo "";  
    echo "  ";
    echo "  ";
    echo "  ";
    echo "      ";

         }

    echo"
  
        
人气

      
  
        
文章题目

      
  
        
作者

      
  
        
日期

      
";
    echo "    
".$row["number"]."
";
    echo "  
";
    echo "    ";
    echo "  
";
    echo "    
".$row["userid"]."
";
    echo "  
";
    echo "    
".$row["date1"]."
";
    echo "  
";                
    echo "

  
";
   for($i=1;$i<=$page;$i++)
{
echo "[".$i."] ";
   }
   ?>
    



  
  我要发言

 


 




www.bkjia.comtruehttp://www.bkjia.com/PHPjc/315710.htmlTechArticle//此页面为php3.php ? include signup/mysql.inc; switch($part){ case 1 :$table=bbs_php;break; case 2 :$table=bbs_mysql;break; case 3 :$table=bbs_html;break; case 4 :$table=bbs_js;...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template