You want to select all the records except thos records with a forumid of 5,18 and 19? Is that right? You need to use logical AND not OR. If I am correct that sql statement will be returning all the records. Right?
PHP Code:
$myselect = "SELECT *
FROM thread
WHERE forumid <> 5
AND forumid <> 18
AND forumid <> 19
ORDER BY lastpost DESC
LIMIT 10";
With logical OR only one of the conditions needs to be true for the result to evaluate to true. So if you construct a truth table you can see that all records will evaluate to true:
Code:
| <>5 | <> 18 | <> 19 | <>5 OR <> 18 OR <> 19
5 | F | T | T | T
18 | T | F | T | T
19 | T | T | F | T
Hehe, I don't know if that looks like a table to you - it looks ok in my browser.
Bookmarks