Answer the question
In order to leave comments, you need to log in
How to fix the filter?
Hello, I wrote this code
$query = "SELECT * FROM products WHERE brand = '".$_POST["category"]."' ";
$brand = $_POST['category'];
if (isset($brand)){
$brandsdata =implode(",", $brand);
$query .= " AND brand IN('$brandsdata')";
}
The essence of the problem is that $brandsdata does not matter made a vardump check"SELECT * FROM products WHERE brand = 'Gigabyte' AND brand IN('')"
What is my mistake? The post is an array and the imploud should turn it into a string. But for some reason it does not.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question