title: Mysql Select query for same column name but with different values
body: <p>I have this table:</p>
  
  <pre><code>id sh_id meta_key meta_value
  1   1    country   111
  2   1    state      10
  3   1    city       5
  4   2    country   110
  5   4    state     11
  ....
  </code></pre>
  
  <p>I will pass an array value to the function. and the array contains value like below</p>
  
  <pre><code>$array = array('country_id'=&gt;111,'state_id'=&gt;10,'city_id'=&gt;1);
  
  function getValue($array)
  </code></pre>
  
  <p>I want to get the result of those array values should match with the meta_key and the meta_value</p>
  
  <p>For example : The query match with the country_id value of the array with the meta_value and the meta_key 'country' as well as state and city</p>
  
  <p>It should be in one query .</p>
  
  <p>I have tried the below query and it's not working</p>
  
  <pre><code>$this-&gt;db-&gt;where('meta_key', 'country');
  $this-&gt;db-&gt;or_where('meta_value', $array['country_id']);
  $this-&gt;db-&gt;where('meta_key', 'state');
  $this-&gt;db-&gt;or_where('meta_value', $array['state_id']);
  $query = $this-&gt;db-&gt;get("at_featured_shops");
  </code></pre>