数据库bb 表News中
进行分页的代码
int PageSize = 5;//每页显示记录数
int StartRow = 0; //开始显示记录的编号问题是:
rs = statement.executeQuery("select title,content,src,anthor,pubdate from news order by id desc LIMIT "+StartRow+", "+PageSize);//DESC 代码加上这句分页成功,但编辑和删除确不能实现,若去掉这句话,分页不能实现但编辑和删除能实现这是什么原因
进行分页的代码
int PageSize = 5;//每页显示记录数
int StartRow = 0; //开始显示记录的编号问题是:
rs = statement.executeQuery("select title,content,src,anthor,pubdate from news order by id desc LIMIT "+StartRow+", "+PageSize);//DESC 代码加上这句分页成功,但编辑和删除确不能实现,若去掉这句话,分页不能实现但编辑和删除能实现这是什么原因
rs = statement.executeQuery("select id,title,content,src,anthor,pubdate from news order by id desc LIMIT "+StartRow+", "+PageSize);//DESC
加个id应该就行了