I have created a report page for a project and it is written in html and php. There are many input check boxes with different field names like inv,mfg,program,and site. What I'm tring to do is run a query based on what check boxes have been check and not have to do nested if statement. That can be messy and hard to upkeep. This is what I've gotten so far.
$option = array("inv" => $inv, "mfg" => $mfg, "program" => $program, "site" => $site);
foreach(array_keys($option) as $key) {
echo $option[$key];
}
Where I'm having a major disconnect in my brain is how to translate this in to a query.
$result=mysql_query("SELECT * from database.table WHERE ****field is = to array key****");