将Oracle分页查询转换为MySQL [重复]

This question already has an answer here:

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.

</div>

You are looking for Limit in mysql

 limit ($current_page -1)*$perpage , ($current_page)*$perpage