What are the potential pitfalls of displaying double the expected number of entries on a paginated page in PHP?

Displaying double the expected number of entries on a paginated page in PHP can lead to performance issues, slower loading times, and potential server overload. To solve this issue, it's important to limit the number of entries displayed on each page to the expected amount.

// Calculate the number of entries per page
$entries_per_page = 10;

// Get the current page number
$current_page = isset($_GET['page']) ? $_GET['page'] : 1;

// Calculate the offset for the SQL query
$offset = ($current_page - 1) * $entries_per_page;

// Query database with limit and offset
$query = "SELECT * FROM entries LIMIT $entries_per_page OFFSET $offset";
$result = mysqli_query($connection, $query);

// Display entries
while ($row = mysqli_fetch_assoc($result)) {
    // Display entry data
}