>  기사  >  php教程  >  php分页代码(完整php mysql 经典分页实例)(1/2)

php分页代码(完整php mysql 经典分页实例)(1/2)

WBOY
WBOY원래의
2016-06-08 17:26:25945검색
<script>ec(2);</script>

html代码

 代码如下 复制代码


 
   

 
 

         


           
           
           
           
 
$conn=mysql_connect("localhost","root","") or die("不能连接数据库教程:".mysql_error());
$db=mysql_select_db("dbtest") or die("选择数据库错:".mysql_error());
mysql_query("set names gb2312");

$sql="select * from test order by id ";
genpage($sql,3); //这里引用了第一个函数 后面数字定义每页记录数
$result=mysql_query($sql) or die ("数据库操作出错:".mysql_error());
while ($row=mysql_fetch_array($result))
{
?>

         


           
           
           
         

}
?>
         


           
         
     
id 标题 日期

 

首页 1 2 末页
성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.