You're trying to integrate the plugin I just gave you inside your own code, you don't need to do all that. You're better off just using the plugin that I posted, and fixing your sql.cfg
The error however is caused by a lack of line breaks. Look closer at the code I posted:
Spoiler
PHP Code:
format( sQuery, charsmax(sQuery),
"\
WITH rankedPlayers AS ( \
SELECT \
`steamid`, \
`name`, \
`score`, \
`points`, \
`infections`, \
`kills`, \
`deaths`, \
RANK() OVER (ORDER BY `score` DESC) AS rank, \
(SELECT COUNT(*) FROM `%s`) AS total_players \
FROM \
`%s` \
) \
SELECT \
`steamid`, \
`name`, \
`score`, \
`rank`, \
`total_players`, \
`points`, \
`infections`, \
`kills`, \
`deaths` \
FROM \
rankedPlayers \
WHERE \
`steamid` = '%s'; \
",
TABLE, TABLE, sAuth
);
There's a line break character '\' which is used to continue a line of code on the next line without breaking the syntax. Since you've removed all of them, the syntax breaks, and throws this error. Its saying "You have no rank", because the query doesn't return any results due to the broken syntax.
__________________