title: MySQL query with multiple OR conditions and a single AND condition
body: <p>I have a MySQQL database table in which I dynamicly build the SQL statement with PHP based on some user input.</p>
  
  <p>The SQL end up looking something like this....</p>
  
  <pre><code>SELECT * 
  FROM  `nam_order_items` 
  WHERE item_status =  'Glass Bending - Andy'
  OR item_status =  'Glass Bending - Bren'
  OR item_status =  'Glass Bending - Gary'
  OR item_status =  'Glass Bending - James'
  OR item_status =  'Glass Bending - Oscar'
  AND (
  `backing_cut` =0
  )
  </code></pre>
  
  <p>Basically DB column <code>item_status</code> can be any of them and column <code>backing_cut</code> can be 0 or 1.</p>
  
  <p>With this SQL above, it returns all the records matching the <code>item_status</code> values regardless of there <code>backing_cut</code> value.</p>
  
  <p>It should allow me to filter out records from the result based on the <code>backing_cut</code> being a value of 0 or 1.</p>
  
  <p>What am I doing wrong?</p>
  
  <p>In addition to above SQL I also tried....</p>
  
  <pre><code>SELECT * 
  FROM  `nam_order_items` 
  WHERE item_status =  'Glass Bending - Andy'
  OR item_status =  'Glass Bending - Bren'
  OR item_status =  'Glass Bending - Gary'
  OR item_status =  'Glass Bending - James'
  OR item_status =  'Glass Bending - Oscar'
  AND `backing_cut` =0
  </code></pre>
  
  <p>AND</p>
  
  <pre><code>SELECT * 
  FROM  `nam_order_items` 
  WHERE item_status =  'Glass Bending - Andy'
  OR item_status =  'Glass Bending - Bren'
  OR item_status =  'Glass Bending - Gary'
  OR item_status =  'Glass Bending - James'
  OR item_status =  'Glass Bending - Oscar'
  (
      AND `backing_cut` =0
  )
  </code></pre>