title: how do I get month from date in mysql
body: <p>I want to be able to fetch results from mysql with a statement like this:</p>
  
  <pre><code>SELECT * 
    FROM table 
   WHERE amount &gt; 1000 
  </code></pre>
  
  <p>But I want to fetch the result constrained to a certain a month and year (based on input from user)...  I was trying like this:</p>
  
  <pre><code>SELECT * 
    FROM table 
   WHERE amount &gt; 1000 
     AND dateStart = MONTH('$m')   
  </code></pre>
  
  <p>...<code>$m</code> being a month but it gave error. </p>
  
  <p>In that table, it actually have two dates:  <code>startDate</code> and <code>endDate</code> but I am focusing on <code>startDate</code>. The input values would be month and year. How do I phrase the SQL statement that gets the results based on that month of that year? </p>