Jump to content

Obtener top del ranking.


SeMa™
 Share

Recommended Posts

Hola, pues... eso yo por aquí... no se me ocurre la forma de hacer una query y obtener tu numero del ranking ( dando el nombre del pj )

 

Y no quiero comerme la cabeza así que... si ustedes quereis, adelante.

 

Un saludo.

 

 

Link to comment
Share on other sites

SELECT id, name, level, rang
FROM
(SELECT id, name, level, @num := @num +1 AS rang
FROM
(SELECT player.id, player.name, player.level, @num :=0
FROM player.player
LEFT JOIN player.player_index ON player_index.id = player.account_id
INNER JOIN account.account ON account.id=player.account_id
WHERE player.name NOT LIKE '[%]%' AND account.status!='BLOCK'
ORDER BY player.level DESC
) AS t1
) AS t2
WHERE name LIKE '$VAR_NAME_EN_TU_FORMULARIO' LIMIT 1;

Link to comment
Share on other sites

SELECT id, name, level, rang

FROM

(SELECT id, name, level, @num := @num +1 AS rang

FROM

(SELECT player.id, player.name, player.level, @num :=0

FROM player.player

LEFT JOIN player.player_index ON player_index.id = player.account_id

INNER JOIN account.account ON account.id=player.account_id

WHERE player.name NOT LIKE '[%]%' AND account.status!='BLOCK'

ORDER BY player.level DESC

) AS t1

) AS t2

WHERE name LIKE '$VAR_NAME_EN_TU_FORMULARIO' LIMIT 1;

Gracias

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...