I've got a table called "posts
", and within that table a column with "post_id
" (A long with other columns ofc).
How to I select the next (or previous) row from the table, by "post_id
"?
Let's say my current "post_id
" is 15. Now I need to select the next row, where certain conditions are met, so I need to put in some where clauses.
I'm bad at explaining this I feel. I'm looking for something like this:
SELECT (next row) FROM posts WHERE post_draft=0 && post_approved=1
Can anybody help me with this?