I have a query that gets item IDs from a table t1.
I also have another table, t2.
t2
------------
itemID
event1 // 0 or 1
event2 // 0 or 1
I need to rewrite my t1 query to exclude item IDs if it corresponds to t2.itemID and if t2.event2 = 1
Now, item ID may or may not be in t2. I was thinking of doing something like
"SELECT t1.itemID
FROM t1
LEFT JOIN t2 ON (t1.itemID = t2.itemID)
WHERE t1.order IN (".$orders.")
AND t2.itemID !=1 "
..I've tried, but it doesn't work. Works fine without AND t2.itemID !=1
What am I missing?