Martin,
Unfortunately I don't know much about MySQL as my background is MS SQL Server.
However, you can definitely use stored procedures:
http://www.mysqltutorial.org/introduction-to-sql-stored-procedures.aspx
As for Row_Number() type functionality, I don't know if the partitioning capabilities are available, but I found the following link which discusses adding a rownumber field:
http://jimlife.wordpress.com/2008/09/09/displaying-row-number-rownum-in-mysql/
In conjunction with stored procedures, it should provide the same paging functionality, if this is what you were after.
Hope that helps,
Regards,
Lawrence