I am making a checkbox filter, I need to place the associative array chosen from the chekboxes in the sql statement so that in this case it shows the results of these two categories but I have not yet been able to achieve it if you can help me thanks
$array_category = array(
"1" => "design",
"2" => "food",
);
if ($sentence= $db->query("SELECT * FROM post WHERE state = 1 AND category IN ".implode(",", $array_category).")"){
"SELECT * FROM post WHERE state = 1 AND category IN ('".implode("','", $array_category)."')"