title: Grabbing rows from MySql where current date is in between start date and end date (Check if current date lies between start date and end date)
body: <p>I'm trying to select from the database to get the "campaigns" that dates fall into the month. So far i've been successful in grabbing rows that starts or ends inside the current month. What I need to do now is select rows that start in one month and ends a few months down the line ( <strong>EG:</strong> <em>It's the 3rd month in the year, and there's a "campaign" that runs from the 1st month until the 5th.</em> other example <em>There is a "campaign" that runs from 2012 until 2013</em> )</p>
  
  <p>I'm hoping there is some way to select via MySql all rows in which a capaign may run. If not should I grab all data in the database and only show the ones that run via the current month.</p>
  
  <p>I have already made a function that displays all the days inbetween each date inside an array, which is called "dateRange". I've also created another which shows how many days the campaign runs for called "runTime".</p>
  
  <p><strong>Select all</strong> <em>(Obviously)</em></p>
  
  <pre><code>$result = mysql_query("SELECT * FROM campaign");
  </code></pre>
  
  <p><strong>Select Starting This Month</strong></p>
  
  <pre><code>$result = mysql_query("SELECT * FROM campaign WHERE YEAR( START ) = YEAR( CURDATE( ) ) AND MONTH( START ) = MONTH( CURDATE( ) )");
  </code></pre>
  
  <p><strong>Select Ending This Month</strong></p>
  
  <pre><code>$result = mysql_query("SELECT * FROM campaign WHERE YEAR( END ) = YEAR( CURDATE( ) ) AND MONTH( END ) = MONTH( CURDATE( ) ) LIMIT 0 , 30");
  </code></pre>
  
  <p><strong>Code sample</strong></p>
  
  <pre><code>while($row = mysql_fetch_array($result))
  {
  $dateArray = dateRange($row['start'], $row['end']);
  
  echo "&lt;h3&gt;" . $row['campname'] . "&lt;/h3&gt; Start " . $row['start'] . "&lt;br /&gt; End " . $row['end'];
  echo runTime($row['start'], $row['end']);
  print_r($dateArray);
  }
  </code></pre>
  
  <p>In regards to the dates, MySql database only holds start date and end date of the campaign.</p>