I have a store procedure that ranks a leaderboard table. How can I pull the rank of a specific userid from the array? This is the array my procedure dumps when I perform this query:
$userposition = $wpdb->get_results("CALL addrank");
print_r($userposition);
Array Output:
Array ( [0] => stdClass Object ( [userid] => 11 [Result] => 69 [Bonus] => 0 [Total] => 69 [Rank] => 1 ) [1] => stdClass Object ( [userid] => 32 [Result] => 38 [Bonus] => 0 [Total] => 38 [Rank] => 2 ) [2] => stdClass Object ( [userid] => 37 [Result] => 38 [Bonus] => 0 [Total] => 38 [Rank] => 2 ) [3] => stdClass Object ( [userid] => 7 [Result] => 38 [Bonus] => 0 [Total] => 38 [Rank] => 2 ) [4] => stdClass Object ( [userid] => 19 [Result] => 38 [Bonus] => 0 [Total] => 38 [Rank] => 2 )
Thanks in advance for the help.