Üyelerimin olduğu bir puan tablosu var

uye_id | puan
1 | 250
2 | 125
3 | 175
4 | 100
5 | 275
.
.
100 | 540

şeklinde bir tablo


Bu tabloyu limit fonksiyonu kullanarak sayfada gösterilecek kayıt sayısını veriyorum. Örneğin bir sayfada 20 kayıt...


Ancak kayıt listeme sayfasında puanı yüksekten küçüğe doğru sıralama şeklinde geldiğinde örneğin 25 sıralamada olan kişi direkt olarak ikinci sayfayı görmesini istiyorum.

Şuanda listele dediğimde normal olarak ilk sayfadan başlıyor ve ileri tuşuna bastığında kendisini görüyor... Kaçıncı sayfada olduğunu direkt görmesi için nasıl bir fonksiyon kullanmam gerekiyor.


Kullandığım Puan listelem kodum;

<table width="100%" border="0" cellpadding="3">
  <tr>
    <td width="30" bgcolor="#FF9900">&nbsp;</td>
    <td height="30" bgcolor="#FF9900"><div align="left" class="style3">Üye Adı</div></td>
    <td bgcolor="#FF9900"><div align="center" class="style3"><strong>Genel Puan</strong></div></td>
    <td bgcolor="#FF9900"><div align="center" class="style3">
      <div align="center">Kodu</div>
    </div></td>
  </tr>
<%

deste = 20
If Request.QueryString("s") <> "" Then 
  Sayfa = CInt(Request.QueryString("s"))
Else 
  Sayfa = 1
End If 

'Toplam hesaplama
Set topla = baglanti.Execute("select count(uye_id) AS toplam from uyeler")
TopKayit = topla(0)
hesapla = CInt(topla("toplam"))
'Toplam hesaplama bitti

set SQLuye =Baglanti.Execute("Select * from uyeler order by puan desc LIMIT "& (deste*Sayfa)-(deste) & "," & deste)
if SQLuye.eof or SQLuye.bof then
Response.Write ""
else

for k=1 to hesapla
if SQLuye.eof then exit for

if SQLuye("uye_id") = session("uye_id") then 
%>
 <tr bgcolor="#CC3300">
<% else %>
 
  <tr bgcolor="#<%
if k mod 2 then
Response.Write "333333"
Else
Response.Write "666666"
end if %>">
<% end if %>
    <td><div align="center"><%= deste*Sayfa+k-deste %></div></td>
    <td height="25"><%
Response.Write "<a href=""#"">"& SQLuye("uye_adi") &"</a>"

%></td>
    <td><div align="center"><font color="#FFFFFF">
      <%
Response.Write SQLuye("puan")
%>
    </font></div></td>
    <td><div align="center">
      <%
Response.Write SQLuye("kodu")
%>
    </div></td>
  </tr>
  <%
SQLuye.movenext
next
SQLuye.close
set SQLuye = nothing
end if %>
</table>

<div align="center">

<%
If CInt(TopKayit) > CInt(deste) Then 
SayfaSayisi = CInt(TopKayit) / CInt(deste) 

If InStr(1,SayfaSayisi,",",1) > 1 Then SayfaSayisi = CInt(Left(SayfaSayisi,InStr(1,SayfaSayisi,",",1))) + 1 

If SayfaSayisi > 1 Then 
Response.Write "<a class=""pagenav"" href=puanlar.asp?s=1><< İlk</a> "
if Sayfa = 1 then
Response.Write ""
else
Response.Write "<a class=""pagenav"" href=puanlar.asp?s="&Sayfa-1&">< Önceki</a> "
end if

for t=d to Sayfa-1
if Sayfa > Sayfa-10 and t > Sayfa-10  and t > 0 then
Response.Write " <a class=""pagenav"" href=puanlar.asp?s=" & t & "><b>" & t & "</b></a> "
end if
next 

For d=Sayfa To Sayfa+9
if d = CInt(Sayfa) then
Response.Write "<span class=""pagenav""><b>" & d & "</b></span>"
elseif d > CInt(SayfaSayisi+1) then
Response.Write ""
else
Response.Write " <a class=""pagenav"" href=puanlar.asp?s=" & d & "><b>" & d & "</b></a> " 
end if
Next


if Sayfa = CInt(SayfaSayisi+1) then
Response.Write ""
else
Response.Write " <a class=""pagenav"" href=puanlar.asp?s="&Sayfa+1&"> Sonraki ></a> "
Response.Write " <a class=""pagenav"" href=puanlar.asp?s="&CInt(SayfaSayisi+1)&">Son >></a>"
end if


End If 
End If 
%></div>