How can I convert this pagination query to be compatible with MySQL:
'SELECT *
FROM ( select p.*, ROWNUM rnum
FROM ( select * from employees ) p
WHERE ROWNUM <= '.(($current_page)*$perpage).' ) where ROWNUM > '.(($current_page -1)*$perpage)';
This query is used inside a PHP script and works without problems.