Hi guys
Have a set of results in a table that look like this:
[code=php]id,name,points
23,dave,34
24,fred,2
46,tyler,18
50,jone,124[/code]
Now, in a SQL statement, I want to pull a line of data by calling its "id" and then getting its position in the database compared to the other results in the table.
So if I do a "WHERE id = '46'", it must return the position of that set of data in relation to the amount of "points" that the other results have.
For example:
1. I need to sort the data in DESC order:
50,jone,124
23,dave,34
46,tyler,18
24,fred,2
2. Then I need to get the position of "id" 46, so my end result would like so:
"tyler" is at position 3 with 18 points