I'm writing a simple forum system to go along with one of my projects - nothing fancy, just categories, forums, threads, and posts. Some threads, however, are marked as 'stick', which means that they're stickies. No matter how many threads there are or where they're posted on, they always must appear at the top of the forum. However, the other threads are paginated.
I've tried using the following mysql query to select 20 normal threads and all stickies, but it doesn't work. Is there a way to get around this in the actual query, or should I resort to using multiple queries in the PHP to get the other threads?
SELECT * FROM `threads` WHERE `forumid` = 1 AND (`status` = 'none' LIMIT 20) OR (`status` = 'stick')
Thanks! (This is in the PHP forum as I'm not sure if the solution is in PHP or MySQL)