Given the MySQL primary key of a particular element in a paginated result set, is there a function to get the page number that element is in?
If not, what is some pseudocode that can help me get there? Note that primary keys can be deleted and there will be 'gaps' in the sequence so simple arithmetic alone might not work...