Basically I want to run a query that selects everything from the table 'base_items_cp', but only if the row 'cd' is equal to the variable $ccd . The row 'type' must also be equal to either 'weapon', 'armour', 'boots', 'gloves' or 'helmet'. Here was my test query: SELECT * FROM base_items_cp WHERE cd='$ccd' AND type='helmet' OR type='gloves' OR type='boots' OR type='armour' OR type='weapon' PHP: But that took rows regardless of the type, anyone know how to fix this?
I had to test this to see if it would work, and apparently you need to place the OR clause between brackets, like this: SELECT * FROM base_items_cp WHERE (type='helmet' OR type='gloves' OR type='boots' OR type='armour' OR type='weapon') AND cd='$ccd' PHP:
Thanks a lot, I'll try it out. I actually thought of that, but that was my stupid Math brain coming into place XD . EDIT: Yep it worked, thanks.