Your detail info page displays its results based on a unique id, right? When that page is displaying, do a query on the database just for the unique id numbers and read them into an array like $id_array. Find the position in the array of the current page's unique ID and assign that to a variable like $position. Now you know that the unique id of the previous page is $id_array[$position-1] and the next page is $id_array[$position+1]. You should use isset to make sure that those array elements actually have a value. If they do, then make a link to your detail info page and pass in $id_array[$position-1] to go PREV or $id_array[$position+1] to go NEXT. Like this:
echo "<a href=\"display_info_page.php?id=" . $id_array[$position-1] . "\">Previous</a>";