你去phpuser.com上面看一看
绝对有你要的东西
绝对有你要的东西
解决方案 »
- 关于是时间戳对比的问题
- 大家来谈OOP
- 如何在页面做成级联显示啊
- 郁闷了两天的中文乱码问题,急求高手帮忙!
- 大侠们,问个问题,急!
- 请教关于页面语言切换(中英)问题
- javascript能不能控制只提交某些input数据?
- php或者JS实现比较两篇文章的不同
- php能否调用其他程序?如水晶报表?
- 我在php中写了copy("abc.jpg","def.jpg");提示:Warning: Unable to open 'none' for reading: No such file or directory 。我一定给分!
- 关于类的使用……这样不对么???
- 请问header()函数的作用和使用方法
// a.php
//About page move
//get parameter from post or get method
session_start()
if(!session_is_registered("intCurrentPage"))
{ session_register("intCurrentPage");
$intCurrentPage=1;
}
if(isset($gotopage)){
if(abs($gotopage)>1) {$intCurrentPage=$gotopage;//to sign page}
if(abs($gotopage)==1) {$intCurrentPage+=$gotopage;//to up or down page}
}intPageSize=10
mysql_connect(,,);
$result=mysql_db_query("dbname","select * from table limit ". (intCurrentPage-1)*intPageSize,intPageSize)
echo "<table >"
while(mysql_fetch_array($result))
{
//here display then table Rows}
echo "</table>"
echo "<table><tr><td><a href="a.php?gotopage=1">next</a><a href="a.php?gotopage=-1">pre..</a></td></tr></table>"
?>
那不能用这方法。
要用到记录的定位比MYSQL麻烦一点。
这正是MYSQL limit 语法的独到之处啊。
www.chinesehis.com/starry/index.php
有一个办法可以减少一些开销的
表要有ID,先用(假设每页要20 条记录)
select top 20 * from tableName
记下LastID(最后的一个ID),
以后的语句全部用select top 20 * from tableName where id>lastID...
这样就会好一点?试试看