title: Modifying MySQL Where Statement Based on Array
body: <p>Using an array like this:</p>
  
  <pre><code>$data = array
       (
         'host' =&gt; 1,
         'country' =&gt; 'fr',
       )
  </code></pre>
  
  <p>I would like to create a MySQL query that uses the values of the array to form its WHERE clause like:</p>
  
  <pre><code>SELECT *
  FROM table
  WHERE host = 1 and country = 'fr'
  </code></pre>
  
  <p>How can I generate this query string to use with MySQL?</p>