I hope you're all doing well. I am currently working on a PHP and MySQL project and could use some help. I am facing an issue with my SELECT query where I need to filter records based on multiple variables.
The scenario is that I have a table called "products" in my database, which has columns such as "product_name", "category", and "price". Now, I want to retrieve specific products based on the user's input.
For example, let's say the user wants to search for products that fall under the category "Electronics" and have a price less than $100. How can I construct the query to achieve this?
I am familiar with basic SELECT queries in MySQL, but I'm not sure how to handle multiple variables like this in PHP. Can anyone guide me on how to write a SELECT statement that considers multiple conditions (category and price in this case)?
I would really appreciate it if someone could provide me with a code snippet or an explanation that helps me understand how to achieve this. Thank you in advance for your assistance!