The only way I've found is to use your databases offset and limit sql commands. Offset will return records starting at the offset number. Limit will limit the amount returned.
For example:
$sql = "SELECT * FROM records ORDER BY recordid OFFSET 10 LIMIT 10";
This would return records 10 - 20. You can set LIMIT to a user defined variable. Like, "show me 10 records on each page." Then your forward and back buttons would pass the current offset. And you would then pass these two to your SQL.