title: how to get mysql rows on month basis
body: <p>I am in a problem and i am confused. I have a table for events and in it there is a column that holds the timestamp of the date time when it was created. I want to get all events(rows) that were created in this month, the last month, and 2 more month before the last month. So, basically 4 months. I want to show them separately so, i can think i can query the datebase for all rows in this month in one query and another query for previous month and so on for 4 months. The problem is i don't know how can i do that. There is a month() function in mysql but i am lost, no idea how to use it.</p>
  
  <p>Any help would be very much appreciated. Thanks</p>
  
  <p>Edit: table structure is like this.</p>
  
  <pre><code>Title  | Uri  | created
  
  Event  | Event| 1337782223
  name   | uri  |  
  .......
  </code></pre>
  
  <p><strong>EDIT 2</strong></p>
  
  <p>Thanks all for your help..
  I tried it myself and with my friend google...:)
  I used this</p>
  
  <pre><code>SELECT * FROM `events` WHERE MONTH(FROM_UNIXTIME(created)) = $month;
  </code></pre>
  
  <p>and this seems to work for me, i will just pass the month whos rows i want from php thats easier for me...lol</p>
  
  <p>Thanks again to all for your answers its appreciated. This place is awesome</p>