I've been having difficulty returning the correct rows with my SQL query. I want to only return rows with either 31 or 34 as their album_items.id. I want to exclude any other album_items.id from my results. The main line I'm focused on is:
WHERE album_items.album IN (31,34)
For whatever reason, even the rows that don't have album_items.id of 31 or 34 are still being returned. Here's the full query. Is it possible that I haven't used to right syntax?
SELECT * FROM items_table
RIGHT JOIN items_table
ON items_table.id=album_items.id
WHERE album_items.album IN (31,34)
AND items_table.name LIKE '%{$term}%'
OR items_table.description LIKE '%{$term}%'
AND items_table.active != '0'
Thanks for your time, Sarah