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:
Espero que me puedan ayudar <% 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 %>