急 页面是这样的:名称 所用媒体 用户名 频道名称 状态 操作 我要把数据库里的信息这样分页显示出来 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <?if(!isset($current_page)) $current_page = 1;$page_size = 10; //每页显示的记录数$begin_page = ($current_page - 1) * $page_size; $resutl = mysql_query("select count(*) from dbtable");$record_num = mysql_num_rows($result);$total_pages = ceil($record_num / $page_size); //总页数$result = mysql_query("select * from dbtable limit $begin_page,$page_size");echo "<table>";while($rows=mysql_fetch_array($result)){ echo "<tr><td>".$rows[名称]." ".$rows[所用媒体]." ".$rows[用户名]." " .$rows[频道名称]." ".$rows[状态]." ".$rows[操作]."</td></tr>"}echo "</table>";$up_page = $current_page-1;$next_page = $current_page+1;if($current_page!=1) echo "<a href=".$PHP_SELF."?current_page=1>首页</a>";if($current_page>1) echo "<a href=".$PHP_SELF."?current_page=".$up_page.">上一页</a>";if($current_page<$total_pages) echo "<a href=".$PHP_SELF."?current_page=".$next_page.">下一页</a>";if($current_page != $total_pages) echo "<a href=".$PHP_SELF."?current_page=".$total_pages.">末页</a>";?> PHP怎样获取mysql里textarea的回车显示文本 PHP socket通讯问题,如何 让服务器和客户端连接后,不断开进行通讯? php连接mysql问题 使用session_set_save_handler函数实现将session保存在数据库中后session不能跨页面了! Php4不支持libxml的吗???? php乱码 有关安全性的问题! 向高手请教-----动态生成新建列表左侧邮箱目录的问题!!!! ORACLE数据库与PHP的问题!参与者也有分,写完程序给100分 2008版本Windows服务器的httpd.ini应该怎么写? 着个函数什么意思? 关于表单提交查询问题
if(!isset($current_page)) $current_page = 1;
$page_size = 10; //每页显示的记录数
$begin_page = ($current_page - 1) * $page_size;
$resutl = mysql_query("select count(*) from dbtable");
$record_num = mysql_num_rows($result);
$total_pages = ceil($record_num / $page_size); //总页数
$result = mysql_query("select * from dbtable limit $begin_page,$page_size");echo "<table>";
while($rows=mysql_fetch_array($result)){
echo "<tr><td>".$rows[名称]." ".$rows[所用媒体]." ".$rows[用户名]." " .$rows[频道名称]." ".$rows[状态]." ".$rows[操作]."</td></tr>"
}
echo "</table>";$up_page = $current_page-1;
$next_page = $current_page+1;
if($current_page!=1)
echo "<a href=".$PHP_SELF."?current_page=1>首页</a>";
if($current_page>1)
echo "<a href=".$PHP_SELF."?current_page=".$up_page.">上一页</a>";
if($current_page<$total_pages)
echo "<a href=".$PHP_SELF."?current_page=".$next_page.">下一页</a>";
if($current_page != $total_pages)
echo "<a href=".$PHP_SELF."?current_page=".$total_pages.">末页</a>";
?>