Welcome to the Treehouse Community
Looking to learn something new?
Giles Buchanan3,824 Points
finding the position of data in an array? is that the count() function?
I have an array multiple columns... its list the users, score and the game name. users can have multiple games at different scores
user_id score Game 1 1000 tanks 3 500 tanks 7 200 submarine 1 2000 submarine 9 750 tanks 8 745 tanks 1 2000 space
I need to find for a particular user their rank for a particular game.
for example what rank is user 9 in tanks? I know I need ORDER BY score DESC, WHERE 'game' = 'tanks' but the actual counting bit has be baffled.
I'm tempted to use a for while loop but this seems clumsy?
is there a PDO/MySQL solution?