BBS(php & mysql)完整版(三)
2008-02-15 17:59:00 来源:WEB开发网核心提示:<div align="center"><font color="#CC33CC" size="2">日期</font></div> </td> </tr> <? $sql
<div align="center"><font color="#CC33CC" size="2">日期</font></div>
</td>
</tr>
<?
$sql="select * from ".$table." order by row DESC";
$result=MySQL(和PHP搭配之最佳组合)_query($sql)or die(MySQL(和PHP搭配之最佳组合)_error());
$row1=MySQL(和PHP搭配之最佳组合)_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(和PHP搭配之最佳组合)_query($sql)or die(MySQL(和PHP搭配之最佳组合)_error());
while($row=MySQL(和PHP搭配之最佳组合)_fetch_array($result)){
static $i=0;
$i++;
if($i%2)
$color="CCCCFF";
else $color="FFCCFF";
echo "<tr>";
echo " <td width=10% bgcolor=#".$color."> ";
echo " <div align=center><font size=2 color=#3333FF>".$row["number"]."</font></div>";
echo " </td>";
echo " <td width=38% bgcolor=#".$color."> ";
echo " <div align=center><font size=2 color=#3333FF><a href='look.php?id=".$row["id"]."&&table=".$table."'>".$row["title"]."</a></font></div>";
echo " </td>";
echo " <td width=26% bgcolor=#".$color."> ";
echo " <div align=center><font size=2 color=#3333FF>".$row["userid"]."</font></div>";
echo " </td>";
echo " <td width=26% bgcolor=#".$color."> ";
echo " <div align=center><font size=2 color=#3333FF>".$row["date1"]."</font></div>";
更多精彩
赞助商链接