数据库创建以及测试数据插入示例:
create table goods(
goods_id int unsigned not null primary key auto_increment,
goods_name varchar(32) not null,
market_price float not null
);
insert into goods values(null, '测试1', 32.43);
insert into goods values(null, '测试2', 32.43);
insert into goods values(null, '测试3', 32.43);
insert into goods values(null, '测试4', 32.43);
insert into goods values(null, '测试5', 32.43);
insert into goods values(null, '测试6', 32.43);
insert into goods values(null, '测试7', 32.43);
insert into goods values(null, '测试8', 32.43);
insert into goods values(null, '测试9', 32.43);
insert into goods values(null, '测试10', 32.43);
insert into goods values(null, '测试11', 32.43);
insert into goods values(null, '测试12', 32.43);
insert into goods values(null, '测试13', 32.43);
insert into goods values(null, '测试14', 32.43);
insert into goods values(null, '测试15', 32.43);
insert into goods values(null, '测试16', 32.43);
insert into goods values(null, '测试17', 32.43);
分页类的实现:
class page
{
private $total; //总记录数
private $size; //每页记录数
private $url; //URL地址