Paging Records from SQL Using Native PHP
Explanation of code in spanish https://www.netveloper.com/paginacion-de-registros-en-php-desde-mysql
To test it lauch a php server
php -S 127.0.0.1:8000
And view in http://127.0.0.1:8000/index.php?page=10-0-1 for testing.