Below is my SQL statement to get all Wordpress posts that aren't of those IDs.
SELECT *
FROM wp_posts as p
WHERE post_type = 'post'
AND post_status = 'publish'
AND post_author = 2
AND ID NOT IN ( 278,268 )
ORDER BY post_date DESC
LIMIT 2 OFFSET 2
I'm loading posts via ajax from user submissions and I don't want duplicate posts to load so I thought I would limit that by storing the post ids in a session and checking again them when the sql is called again.
This won't get the proper response. If I remove any of the other ANDs then it will work but as it sits right now, it doesn't work. What the heck is wrong with it? There are no errors that come back