i want to add next and previous links for my data table. how to write query to get data in next and prevous links data
<div>
<a style="margin-left:5px;" href="#" class="previous">« Previous</a>
<a style="margin-left:5px;" href="#" class="next">Next »</a>
</div>
$recordsPerPage = 20;
$totalPages = ceil($totalCount / $recordsPerPage);
$page = isset($_GET['page']) ? $_GET['page'] : 1;
$offset = ($page - 1) * $recordsPerPage;
$query = "SELECT * FROM history" . $whereClause . " LIMIT " .$recordsPerPage. "OFFSET " .$offset.";";
i am expecting to get data only 20 entries first when i click on next i want to show next 20 entries