prosportal
20 Nov 2011, 10:04 AM
I'm doing a ranking system which includes searching someone's rank. When the result is returned, I want to show the two people before that person and the two people after that person. I'm not sure of what type of query I would use.
My standard query would be $mysqli->query("SELECT rank,name FROM users WHERE name = '$search' LIMIT 1");
but in this case, I want to also retrieve the other users as well.
Rank Name
50 Person1
51 Person2
53 SEARCH RESULT
54 Person4
55 Person5
My standard query would be $mysqli->query("SELECT rank,name FROM users WHERE name = '$search' LIMIT 1");
but in this case, I want to also retrieve the other users as well.
Rank Name
50 Person1
51 Person2
53 SEARCH RESULT
54 Person4
55 Person5