A very simple paging technology MySQL (the best combination with PHP) + jsp (the preferred choice for SUN Enterprise Applications) utilizes the LIMIT parameter of MySQL (the best combination with PHP)
Advantages: 1. I figured out 2. I used the LIMIT of MySQL (the best combination with PHP) database.
Disadvantage: only the next page function is implemented.
<%
Int cateID = 0;
If (request. getParameter ("cateID") = null)
... {CateID = 0 ;}
Else ...{
CateID = Integer. parseInt (request. getParameter ("cateID "));
}
Int next_page = cateID + 1;
Int per_page = 5;
Int pagenum = (cateID * per_page) + 1;
If (cateID = 0 )...{
SQL = "select * from BLOG_CONTENT where log_IsTop = 0 order by log_ID desc LIMIT 0," + per_page + "";
} Else ...{
SQL = "select * from BLOG_CONTENT where log_IsTop = 0 order by log_ID desc LIMIT" + pagenum + "," + per_page + "";
}
Rst=stmt.exe cuteQuery (SQL );
While (rst. next ()... {%>
<Div class = "content_head">
<% = Rst. getString ("log_Title") %> [
<% = Rst. getString ("log_PostTime") %> |
<Br>
<% = Rst. getString ("log_Content") %> <br>
<Br>
<% }%>
<Div class = "content_head" align = "right"> <a href = "default. jsp (preferred for SUN Enterprise Applications) "> Home page </a> <a href =" default. jsp (preferred for SUN Enterprise Applications )? CateID = <% = next_page %> "> next page </a> </div>
<Span class = "smalltxt"> </span> </td>
</Tr> </table>
</Td>
</Tr>
</Table>