With the following MySQL table:
+-----------------------------+ + id INT UNSIGNED + + name VARCHAR(100) + +----------------------------
I was going through the accepted answer and it seemed bit complicated so here is the simplified version of it.
SELECT t,COUNT(*) AS position FROM t WHERE name <= 'search string' ORDER BY name