title: MySQL: Multiple AND queries with using BETWEEN?
body: <p>I had seen a colleague use this to fetch users from a table under these conditions:</p>
  
  <pre><code>SELECT * FROM users WHERE gender ='male' 
  AND activated='yes' 
  AND date_registered BETWEEN '$date1' AND '$date2' 
  </code></pre>
  
  <p>He said there was an problem (it not outputting any rows when the <code>AND activated='yes'</code> was put there as well, but no MySQL error was thrown.</p>
  
  <p>Can you not do this? Do you need to put it in brackets or something crazy to associate the <code>BETWEEN</code> and <code>AND</code>?</p>
  
  <p>Dates are in correct format by the way.</p>