I copied a source code from youtube, i did it properly with mysql, but there's showing a big problem woth "endif"
<?php
<?php for($x = 1; $x <= $pages; $x++); ?>
<a href="?pages=<?php echo $x; ?>&per-page=<?php echo $perPage; ?>"><?php echo $x;?></a>
<?php endfor; ?>