title: Using PHP to select table entries using two date fields and current month
body: <p>Please help a newbee. I have a table named event_calendar with fields named ec_start_date, ec_end_date and ec_event_name. The first two fields are date fields. It is a small table, with less than 100 entries. I want to list events with a start or end date in the current month, then I want to follow with a list of events with a start or end date in the next month. The two list will be headed by the month name. I would like the dates displayed in the list to be in the format dd/mm.</p>
  
  <p>This is the code I've found to identify the months for the list headers.</p>
  
  <pre><code>$thismonth = mktime(0,0,0,date("n"));
  $nextmonth = mktime(0,0,0,date("n")+1);
  
  echo "&lt;h2 class='caps'&gt;";
  echo date("n", $thismonth);
  echo "&lt;/h2&gt;";
  
  echo "&lt;h2 class='caps'&gt;";
  echo date("m", $nextmonth);
  echo "&lt;/h2&gt;";
  </code></pre>
  
  <p>This is the code I use to pull the entries for this month's (August) activities</p>
  
  <pre><code>$query = "SELECT ec_display,ec_event_name,ec_start_date,ec_end_date FROM event_calendar WHERE month(ec_start_date) = 8 OR month(ec_end_date) = 8 ORDER BY ec_start_date";
  </code></pre>
  
  <p>The problem is, if I replace the number 8 with the variable $thismonth, it fails.</p>
  
  <p>Finally, how can I display only the dd/mm from ec_start_date and ec_end_date?</p>
  
  <p>I greatly appreciate any guidance, but please be specific as I am very new to this! Thank you!</p>