I have the following html file to send data in form of an associative array. The form is dynamically submitted using Jquery Ajax(no submit button need).

```
<html>
<form id="checkboxform" method="GET">
<input type="checkbox" name="navi[key1]" value="value1" <?php echo array_key_exists("value1",$navi)?"checked":""; ?>> Item1
<input type="checkbox" name="navi[key2]" value="value2" <?php echo array_key_exists("value2",$navi)?"checked":""; ?>> Item2
<input type="checkbox" name="navi[key3]" value="value3" <?php echo array_key_exists("value3",$navi)?"checked":""; ?>> Item3
</form>
</html>

```

Then I have the following php file to process the form and select data from Mysql database. The query is dynamically generated depending on which input field that are checked by the user.

```
    <?php

    if(isset($_GET['navi'])):

        $navi=$_GET['navi'];

        //foreach

        foreach($navi as $key =>$value):
               $query=$key."="."'".$value."'";
        endforeach;

        // run the query using PDO

        $content = $db->getRows("SELECT * FROM products WHERE   $query"); 

    endif;
    ?>

```

My question is the following, how do add "**OR**" after the "**$query**" variable provided that the user selects more than one checkbox. Whick will generate a query that looks like this:

```
SELECT * FROM products WHERE key1='value1' OR key2='value2' OR key3='value3'

```

my code generates the following query without **OR** and its not correct.

```
SELECT * FROM products WHERE key1='value1' key2='value2' key3='value3'

```

thank you