在MySQL用limit的方法就可以簡單達成!!
$per_page=20;
$page=2;
$first_result=($page-1)*$per_page;
"select * from contacts limit $first_result, $per_page order by last_name;";
"select * from contacts order by last_name limit $first_result, $per_page ;";
//自已的範例加了order by
select * from contact_list where order by create_date limit 1,1
尚未考慮最佳解法!!
$per_page=20;
$page=2;
$first_result=($page-1)*$per_page;
"select * from contacts order by last_name limit $first_result, $per_page ;";
//自已的範例加了order by
select * from contact_list where order by create_date limit 1,1
尚未考慮最佳解法!!
沒有留言:
張貼留言
留個話吧:)