title: MySQL Multiple Where Clause
body: <p>I have a table like this:</p>
  
  <pre><code>id  image_id  style_id  style_value
  -----------------------------------
  1   45        24        red
  1   45        25        big
  1   47        26        small
  1   45        27        round
  1   49        28        rect
  </code></pre>
  
  <p>I want to take image_id column if:</p>
  
  <ul>
  <li><code>style_id = 24</code> and <code>style_value = red</code></li>
  <li><code>style_id = 25</code> and <code>style_value = big</code></li>
  <li><code>style_id = 26</code> and <code>style_value = round</code></li>
  </ul>
  
  <p>I have make a query like this:</p>
  
  <pre><code>$query = mysql_query("SELECT image_id FROM list WHERE (style_id = 24 AND style_value = 'red') AND (style_id = 25 AND style_value = 'big') AND (style_id = 27 AND style_value = 'round')
  </code></pre>
  
  <p>But I couldn't get any result. When I make this sample with OR, it works well. But I have to do this with AND. Because I need image id s which are both "red, big and rect".</p>
  
  <p>I have made lots of search with Google but couldn't fine any solution.</p>