hey i am a beginner in PHP and MYSQL, i am stuck with a basic problem. How can i make my query from URL parameters
MY URL EXAMPLES:
www.abs.com/index.php?cat=shoes
www.abs.com/index.php?cat=shoes&subcat=sports
www.abs.com/index.php?cat=shoes&subcat=sports&color=blue
How can i handle this kind of URL's in my query, that is just my example query, i have a large set of fields for both of my tables. I need help with the WHERE part of query, main problem is i am passing (cat) in my URL where it is (b.category) in my database.
MY QUERY:
select a.p_id, a.p_name, a.p_prize, b.p_id b.color, b.category, b.subcategory
FROM products a INNER JOIN details b ON a.p_id=b.p_id