MyBB Community Forums

Full Version: Get new posts and read status at once
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

I have installed plugin which shows latest posts on my board and I have an idea to also check and display the read status (if it's a new post and we still haven't read it, it will be e.g. highlighted).

This is a simplified version of my query:
SELECT tid, subject, lastpost FROM mybb_threads ORDER BY lastpost DESC LIMIT 5
I know how to do it for each post separately but this requires execution of one DB query for each post (+5 queries total).
Is there a way to check the read status of these posts at once without a lots of additional queries?