So I'm making a small database for a restaurant and I am trying to set up an interface for them to be able to select certain criteria and see how much of it they have in stock. For example, if they select "Meat" all of the different types of meat will be listed. This works fine when I query for only one type of meat like this:
SELECT a.name, b.type, a.cost, a.end, a.url
FROM items a, type b
WHERE b.type = a.type
AND b.type="beef";
The result I'd get for that query would list the correct # of elements and so on.
sample result:
However if I add an "OR" clause to try to call every type of meat in stock, for example:
SELECT a.name, b.type, a.cost, a.end, a.url
FROM items a, type b
WHERE b.type = a.type
AND b.type="beef"
OR b.type="poultry";
the first few results will be correct but then it will add in random elements that don't fit any of the criteria and even change certain elements so that they don't match up, for example it will label bananas as poultry or something! I have no idea why it's doing this. It will also repeat a whole ton of items.
Sample results from addition of "or" clause: http://puu.sh/dj5aq/ea7876fb33.png
any idea what I'm doing wrong?
Let me know if you need any more info, I'm not sure if this is sufficient or not.