$perPage = 10; // number of records to display per page $page = isset($_GET['page']) ? $_GET['page'] : 1; // current page number $offset = ($page - 1) * $perPage; // calculate the starting point for this page $sql = "SELECT * FROM my_table LIMIT $perPage OFFSET $offset"; $result = mysqli_query($conn, $sql); // display each record from result set while ($row = mysqli_fetch_assoc($result)) { // display record content }In this example, we first define how many records to display per page using the `$perPage` variable. We then get the current page number from the query string using `$_GET['page']` and calculate the starting point for this page using the formula `$offset = ($page - 1) * $perPage`. We can then use this `$offset` value in our SQL query to retrieve a limited number of records from the database, starting from the calculated offset. This example does not require any package library as it is a simple implementation using PHP and SQL. However, there are various PHP libraries available that provide more advanced pagination functionality, such as Laravel's Paginator or the PHP League's Fractal. These libraries may be more suitable for larger, more complex projects.