I am developing a web application where there are some very similar pages that I would like users to browse. The data for these "pages" is stored in a database with a unique identifier as the primary key.
I would like to have a “NEXT” button on each page that queries the database and finds out what the next highest identifier is and displays data from that identifier. My problem is that there are several conditions:
- Sometimes pages can be deleted or deleted, which means there are spaces in the identifiers, so I cannot just do -1.
- I only need to return pages where the column is "active" == 1
Does anyone have any tips or suggestions? Thank!
source
share