I am using codeigniter and I am trying to get all rows from a database table that are past due and only the ones that are past due.
The table includes a column that is titled due_date
and is formatted as a datetime
Past Due
stands for anything with a due_date
prior to todays date. So for example, if the due date was 04/25/2014 and todays date was 04/26/2014 it would be considered overdue.
My code is as follows:
$query = $this->db->get_where('practice', array('due_date' => date('Y-m-d')));
return $query->result();
But wouldn't that return everything due today? Not quite what I want.
A row would look something like this for the due_date column
2014-04-23 00:00:00