Paging gennem mysql via asp
Hejsa jeg skal bruge noget paging på min side men jeg køre mysql på siden gennem asp så det skal være der igennemscriptet ser sådan her ud
men jeg aner ikke hvordan man laver paging på den
<%
strSQL = \"SELECT persons.*,((hits.vote1+hits.vote2+hits.vote3+hits.vote4+hits.vote5+hits.vote6+hits.vote7+hits.vote8+hits.vote9+hits.vote10) / hits.raters) AS score FROM persons INNER JOIN hits ON hits.pid=persons.id WHERE persons.gender=\" & strGender
Select Case strType
Case \"0\": strSQL = strSQL & \" ORDER BY persons.id DESC;\"
Case \"1\": strSQL = strSQL & \" AND hits.raters>\" & RatersBeforeTop & \" ORDER BY score DESC;\": strSub = \"<span class=\'small\'>You must have \" & RatersBeforeTop & \" Votes before you can join the list!</span>\"
End Select
%>
<br>
<center>
<%=Page_Header%><br>
<%=strSub%>
</center>
<%
Set Rs = Conn.Execute(strSQL)
If Rs.BOF Then
Response.Write \"<hr>Sorry no persons too show :-(\"
Else
PIndex = 1
Do Until Rs.EOF
strName = Rs(\"name\")
strCity =Rs(\"city\")
strCountry = Rs(\"country\")
strText = Rs(\"text\")
If strName > \"\" Then
strProfileHead = strName
If strCity > \"\" Then strProfileHead = strProfileHead & \", \" & strCity
If strCountry > \"\" Then strProfileHead = strProfileHead & \" (\" & strCountry & \")\"
End If
If strText > \"\" Then strProfileContent = strText Else strProfileContent = \"\"
If Len(strProfileContent) > 100 Then strProfileContent = Left(strProfileContent, 100) & \"...\"
%>
<hr>
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">
<tr>
<% If strType = \"1\" Then %>
<td align=\"center\" valign=\"top\" width=\"20\"><font size=\"2\"><b>Nr:<b><%=PIndex%>.</font></b></td>
<% End If %>
<td width=\"75\" valign=\"top\"><a href=\"default.asp?pid=<%=Rs(\"id\")%>\"><img src=\"out_img.asp?pid=<%=Rs(\"id\")%>\" border=\"0\" alt=\"<%=Rs(\"name\")%>\"></a></td>
<td valign=\"top\">
<b><%=strProfileHead%></b>
<p>
<%=strProfileContent%>
</td>
<% If Request.Cookies(\"votes\")(\"pid\" & Rs(\"id\")) > \"\" Then %>
<td bgcolor=\"#2072BE\" width=\"52\" align=\"center\"><b>
<span class=\"score\"><%=FormatNumber(Rs(\"score\"), 2, True)%></span><br>
</b></td>
<% End If %>
</tr>
</table>
<%
Rs.MoveNext
PIndex = PIndex + 1
Loop
End If
%>
PLEASE HEEEEEELLLLLPP
DaffyDK
ps hvis i kikker på siden www.d-soft.dk
Så tror jeg nok i forstår hvad jeg mener :-)
