MySQL Forums
Forum List  »  Newbie

Re: your ranked out #x of X accounts?
Posted by: jeffrey van der veen
Date: July 22, 2011 02:58AM

It's not displaying the text.
here is what i use


CREATE TABLE IF NOT EXISTS `accounts` (
`Name` varchar(24) NOT NULL,
`Kills` int(9) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

$lol = mysql_query("SELECT a.Name, a.Kills, CONCAT(You are ranked ,IF(b.Name IS NULL,CONCAT('#',a.rank), CONCAT('joint #',a.rank,' (along with ',COUNT(b.Name),' more)')),' out of ',(SELECT COUNT(*) FROM accounts)) rank FROM ( SELECT $user, Kills, FIND_IN_SET(Kills, (SELECT GROUP_CONCAT(Kills ORDER BY Kills DESC) FROM accounts)) rank FROM accounts) a
LEFT
JOIN accounts b
ON b.Name = a.Kills
AND a.Name <> b.Name
GROUP
BY a.Name
ORDER
BY Kills DESC");

echo "$lol";

Options: ReplyQuote


Subject
Written By
Posted
Re: your ranked out #x of X accounts?
July 22, 2011 02:58AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.