Ho provato e così funziona.
Ho usato le funzioni di MySQL (davvero potente...) .
codice:
<%
pageSize = 5
if(len(Request.QueryString("page"))=0)then
currentPage = 1
else
currentPage = CInt(Request.QueryString("page"))
end if
If Not IsNumeric (currentPage) Then currentpage = 1
If currentPage < 1 Then currentPage = 1
start = ((currentPage - 1) * pageSize)
If start < 0 Then start = 0
%>
<% SQL = "SELECT SQL_CALC_FOUND_ROWS * FROM tabella LIMIT " & start & ", " & pageSize %>
<% Set RS = Server.CreateObject("ADODB.Recordset") %>
<% RS.Open SQL, objConn %>
<% if Not RS.eof then %>
<% SQL1 = "SELECT FOUND_ROWS() AS rC;" %>
<% Set RS1 = objConn.Execute(SQL1) %>
<% recordCount = RS1("rC") %>
<% Set RS1 = Nothing %>
<% while not RS.eof %>
<% response.write RS("TITOLO") & "
" %>
<% RS.movenext() %>
<% wend %>
<% end if %>
<% RS.Close() : Set RS = Nothing %>
<% if currentPage > 1 then %>
Prev
<% else %>
Prev<% end if %>
|
<% if cInt(start+pageSize) < cInt(recordCount) then %>
Next
<% else %>
Next
<% end if %>