I am trying to filter search result based on brand so it is in array form.Suppose I have two brand check box When I check any one of the check box then it show data but when I both checkthen it show no data . Please help me to fix
I tried var_dump($sql); then it show data brand data in this way
string(13) "Adidas','Zara"
Here is the code
if (isset($search_params['brand']) && is_array($search_params['brand']) && count($search_params['brand']) > 0) {
$brands = $search_params['brand'];
$placeholders = rtrim(str_repeat(':brand, ', count($brands)), ', ');
$sql .= " AND products_brand.brand_name IN ($placeholders)";
$data['brand'] = implode("','", $brands);
}
$data[':status'] = $search_params['status'];
echo var_dump($data);
return $db->read($sql, $data);