title: MySQL select records from specified timeframe
body: <p>I am working on creating a leaderboard for my game and I have the following PHP function that selects data from my database and orders it by score and the WHERE statement restricts it to the month</p>
  
  <pre><code>public function getTopMonthMobileUsersByPoints() {
      try {
          $query = "select
                          u.id 
                          ,u.name
                          ,u.email
                          ,u.password
                          ,u.facebook_id
                          ,u.created_date
                          ,u.token_uid
                          ,sum(s.total_points) as earned_points
                          ,u.used_points
                          ,u.gender
                          ,u.birthdate
                          ,0 AS ranking
                  from 
                      mobile_user u
                      join score s on s.mobile_user_id = u.id
                  where
                      year(report_date) = year(now()) and
                      month(report_date) = month(now()) and 
                  group by
                      u.id
                  having
                      sum(s.total_points) &gt; 0
                  order by 
                      sum(s.total_points) desc
                  limit 100 ";
          $stmt = $this-&gt;db-&gt;prepare($query);
          $stmt-&gt;execute();
          $stmt-&gt;setFetchMode(PDO::FETCH_CLASS, 'class\Model\MobileUser');
          return $stmt-&gt;fetchAll();
      } catch (PDOException $e) {
          $this-&gt;logger-&gt;error("PDO: ".$e-&gt;getMessage(), ["class"=&gt;get_class($this),"method"=&gt;__METHOD__]);
          return null;
      }
  }
  </code></pre>
  
  <p>I want to include a similar function that does basically the same but where the mysql selects records from a given timeframe, for example from June 2018 to August 2018. </p>
  
  <p>Is there a way i can tell mysql to select records from the future? Any guidance is appreciated</p>