title: how can i make this dynamic BETWEEN '2014-07-01 00:00:00' AND '2014-07-31 23:59:59'";
body: <p>Im still a noob php programmer. Please help me with my problem. I was trying to code  a timeline. Im stuck at the query part. Let's say i have a <strong>select</strong> element with the months in it. If ever I want to select the July, the timeline displays all the events listed on July 2014. <strong>What if its already 2015? my query remains static (BETWEEN '2014-07-01 00:00:00' AND '2014-07-31 23:59:59'";)</strong></p>
  
  <pre><code>&lt;?php
  
  mysql_connect("localhost","root","") or die(mysql_error());
  mysql_select_db("prototype") or die(mysql_error());
  
  
  if(isset($_POST['submit'])) {
      if($_POST['month'] == 'July') {
  
  
          $sql = "SELECT * FROM events WHERE event_schedule BETWEEN '2014-07-01 00:00:00' AND '2014-07-31 23:59:59'";
          $query = mysql_query($sql);
  
  
          while ($row = mysql_fetch_array($query)) {
              echo "Title:".$row['event_title']."&lt;br&gt;";
              echo "Description:".$row['event_description']."&lt;br&gt;";
              echo "Schedule:".$row['event_schedule']."&lt;br&gt;";
              echo "Date Created:".$row['date_created']."&lt;br&gt;";
              echo "Posted By:".$row['posted_by']."&lt;br&gt;";
          }
      }
  
      if($_POST['month'] == 'August') {
          $sql = "SELECT * FROM events WHERE event_schedule BETWEEN '2014-08-01 00:00:00' AND '2014-08-31 23:59:59'";
          $query = mysql_query($sql);
  
  
          while ($row = mysql_fetch_array($query)) {
              echo "Title:".$row['event_title']."&lt;br&gt;";
              echo "Description:".$row['event_description']."&lt;br&gt;";
              echo "Schedule:".$row['event_schedule']."&lt;br&gt;";
              echo "Date Created:".$row['date_created']."&lt;br&gt;";
              echo "Posted By:".$row['posted_by'];
          }
      }
  }
  
  echo date("F Y");
  
  
  
  
  ?&gt;
  
  &lt;html&gt;
      &lt;form method="post"&gt;
          &lt;select name="month"&gt;
              &lt;option selected="selected"&gt;Select a month...&lt;/option&gt;
              &lt;option&gt;January&lt;/option&gt;
              &lt;option&gt;February&lt;/option&gt;
              &lt;option&gt;March&lt;/option&gt;
              &lt;option&gt;April&lt;/option&gt;
              &lt;option&gt;May&lt;/option&gt;
              &lt;option&gt;June&lt;/option&gt;
              &lt;option&gt;July&lt;/option&gt;
              &lt;option&gt;August&lt;/option&gt;
              &lt;option&gt;September&lt;/option&gt;
              &lt;option&gt;October&lt;/option&gt;
              &lt;option&gt;November&lt;/option&gt;
              &lt;option&gt;December&lt;/option&gt;
          &lt;/select&gt;
          &lt;input type="submit" name="submit" value="Submit"&gt;
      &lt;/form&gt;
  &lt;/html&gt;
  </code></pre>