I would like to create a query that filters records in a table using a date range.
- The table has a "date" column that follows MM/DD/YYYY format.
I have this existing function that filters the records by "type" automatically, but how can I attach arguments to this function that uses a date range to only show records that fall within the range?
Say, for example, find a record that falls between 04/01/2015 and 04/30/2015.
public function getByType() {
$query = $this->pdo->prepare("SELECT * FROM `" . $this->table . "` WHERE type='hod'");
$query->execute();
if ($query->rowCount() == 0) return null;
}
Thank you!