Quote:
Originally Posted by harmor19
I don't know what I'm doing wrong.
I want to make a query that will return results if the column "required" is 2 or 3 but the column "type" cannot be "input" or "textarea".
PHP Code:
$showfields = $db->query_read("SELECT * FROM ".TABLE_PREFIX."profilefield WHERE required = '2' OR required = '3' AND (type != 'input' OR type != 'textarea') ");
It's returning row 6 even though the type is "textarea".
|
Heh, the problem is your logic. (type != 'input' OR type != 'textarea') is always true, because input will ALWAYS either not be input or not be textarea.
Three of solutions....
AND type not in ("input","textarea")
or
AND !(type="input" or type="textarea)
or
AND (type !="input" and type!="txtarea")