Home > php教程 > php手册 > php简单的分页程序第1/5页

php简单的分页程序第1/5页

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 12:29:57
Original
916 people have browsed it

[code]
 

 
 
用户信息总汇 
 
 
 

 
############################################################# 
###########        连接数据库                ################ 
############################################################# 
$db=mysql_connect("192.168.0.2","root","goalwe608");  //数据库,用户名,密码 
mysql_select_db("86pos",$db);   //数据库 
############# 分页 ############ 
//设定每一页显示的记录数 
$pagesize=5; 
//取得记录总数 
$res=mysql_query("select count(id) from buyer " ,$db); 
$myrow = mysql_fetch_array($res); 
$numrows=$myrow[0]; 
//计算总页数 
$pages=intval($numrows/$pagesize); 
if ($numrows%$pagesize) 
  $pages++; 
//判断页数设置与否,如无则定义为首页 
if (!isset($page)) 
  $page=1; 

//防止恶意访问 
if ($_GET

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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template