title: querying month, day and year in a date
body: <p>In my situation i have a date field in mySQL, and i used to get the value to variable through the code below. This is right when i query a complete date such as "08-28-1989". </p>
  
  <p>mySQL:</p>
  
  <pre><code>SELECT COUNT(*)
  FROM content 
  where dateReceived='{$approved_date}' 
  and description='{$description}'
  </code></pre>
  
  <p>PHP:</p>
  
  <pre><code>   $approved_year   = $_POST["approved_year"];
     $approved_month  = $_POST["approved_month"];
     $approved_day    = $_POST["approved_day"];
     $approved_dt = strtotime($approved_year."-".$approved_month."-".$approved_day);
                      $approved_date  = date("Y-m-d",$approved_dt);
  </code></pre>
  
  <p><br><br>How can I make it more dynamic if i say the user only input "08" (Month only) then it displays all records in that month regardless of day and year. Or the user will just input the month and the year and it just query it to my database.</p>
  
  <p>Here's my HTML also:</p>
  
  <pre><code>&lt;p&gt;
              Date Approved
              &lt;select name="approved_month"&gt;
              &lt;?php
                  $month = array(" ","January","February","March","April",
                                 "May","June","July","August",
                                  "Septembe","October","November","December");
                  for($x=0;$x&lt;12;$x++){
                      echo "&lt;option value=\"".$x."\"&gt;".$month[$x]."&lt;/option&gt;";
                  }
              ?&gt;
              &lt;/select&gt;
              &lt;input type="text" name="approved_day" value="" size="2" /&gt;
              &lt;input type="text" name="approved_year" value="" size="10" /&gt;
  &lt;/p&gt;
  </code></pre>