Tema: Ranking
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 23/06/2003, 09:47
Avatar de meru-kun
meru-kun
 
Fecha de Ingreso: noviembre-2002
Ubicación: Madrid
Mensajes: 854
Antigüedad: 22 años, 5 meses
Puntos: 0
Ranking

Bien, pretendo hacer un ranking en mi web, en funcion de las veces que han añadido mensajes al foro, han escrito alguna seccion, o lo que sea.

Todos los usuarios los tengo en una DB, y en ella tengo sus ID´s. Luego, en la DB de la web, en cada seccion, tengo la ID del autor, asi que lo unico que tengo que hacer es contar las veces que han añadido algo, y ya esta. Asi consigo saber el numero total de aportaciones que han hecho.

Esto en si no es ningun problema, pero si que lo es si quiero ordenar esos usuarios de mayor a menor numero de aportaciones...

Os pongo el codigo que tengo ahora mismo (y es que así me lo muestra todo tal y como estan en la DB ... y no se como hacer para ordenarlos...)

Código:
<%
strSQL = "SELECT MEMBER_ID FROM FORUM_MEMBERS"
 Set MRD = my_conn.Execute(strSQL)
  Do While NOT MRD.EOF or MRD.BOF
 
    intUserID = MRD("MEMBER_ID")

' ** Cogemos el número de posts que tiene...
   strSQL = "SELECT M_POSTS FROM FORUM_MEMBERS WHERE MEMBER_ID=" & intUserID
    Set MRP = my_conn.execute(strSQL)
     intPosts = MRP("M_POSTS")
      intZAPosts = cInt(cInt(intPosts)) ' ** Modificador del valor de los posts..
       MRP.Close

   strSQL2 = "SELECT COUNT(ID) AS intSecc FROM GAMES_SECC WHERE AUTOR_ID=" & intUserID
     Set MRS = Server.CreateObject("ADODB.Recordset")
      MRS.Open strSql2, MyConn
       intSecc = MRS("intSecc")
        intZASecc = cInt(intSecc) * 50 
         MRS.Close
   strSQL3 = "SELECT Count(ID) AS intLyric FROM LYRICS_LYRICS WHERE AUTOR_ID=" & intUserID
     Set MRL = Server.CreateObject("ADODB.Recordset")
      MRL.Open strSQL3, MyMensConn
       intLyric = MRL("intLyric")
        intZALyr = cInt(intLyric) * 5 
         MRL.Close
     
    response.write getName(intUserID) & "<br>"
	response.write intZALyr & " "
    response.write intZASecc & " "
	response.write intZAPosts & "<br>"

   MRD.MoveNext
  Loop
 MRD.Close 
%>
Espero que me puedan ayudar
__________________
Tu portal de manga y anime.

Última edición por meru-kun; 23/06/2003 a las 10:53