Problem! MySQL query with two INNER JOINS and WHERE with two conditions
I'm thinking this isn't that complicated of an issue, but I can't seem to make it work properly. First, I'm using php and have a total of three tables in my database. The first two tables are simple. The first being the "category" table containing an id and name, and the second being the "collection" table containing again an id and a name. The master table of "products" contains two foreign keys that relate to the id's of both the category and collections tables. Through the dreamweaver recordset panel in advanced mode I'm querying the product table and using two INNER JOINS to combine the category, collection, and products tables together. I'm using a WHERE statement to pull two parameters with an OR. Example code below.
FROM product INNER JOIN category ON idcategory_product=id_category INNER JOIN collection ON idcollection_product=id_collection
WHERE idcategory_product=colname || idcollection_product=colname2
ORDER BY id_product DESC
Default Value: 1
Runtime Value: $_GET['id_category']
Default Value: 1
Runtime Value: $_GET['id_collection']
What I'm trying to do is set the navigation on the index page to jump to the products page and pull the appropriate content. So, when a link in the category column on the index page is selected it will jump to a products page and pull all products of that category and the same with the collections, when a collection is selected it will jump to the same products page and list all items within that collection. The nav on the index is being pulled dynamically from the above mentioned category and collections tables. It is then linked to the products page with set parameters for the id of the given table.
The above query seems to work fine with just one of the WHERE conditions but when I try and set both it just wants to dump all data entries in descending order and not filter at all.
Does anyone have any ideas on how to make this work properly? I should be able to fit it all into the same query.