Need help writing a link with a php parameter to pull all records.
I need help writing a link that will pull all records from a recordset. The link is in the main navigation and it's linking to a products page where I would like to return all the items in descending order. The recordset that currently resides on the products page already has two INNER JOINS and a conditional WHERE statement with an OR operator, but I would like to continue to utilize only one recordset for this page to pull records given any condition. The mySQL looks like this.
SELECT *
FROM product INNER JOIN category ON idcategory_product=id_category INNER JOIN collection ON idcollection_product=id_collection
WHERE idcategory_product=colname OR idcollection_product=colname2
ORDER BY id_product DESC
Variables:
Name: colname
Type: numeric
Default Value: -1
Runtime Value: $_GET['id_category']
Name: colname2
Type: numeric
Default Value: -1
Runtime Value: $_GET['id_collection']
Should I add another condition to the WHERE statement for the id_product, and how should the link for the products page, <a href="products.php?..."></a>, be written?