I have a table with dates and I would like to create a query that returns records with dates before the current day but I could not mount this query; below is my code and BD image:
function get_late_events($sort = 'idevento', $order = 'asc', $limit =null, $offset = null) {
$this->db->order_by($sort, $order);
if($limit){
$this->db->limit($limit,$offset);
}
$this->db->select('idevento, cnome, inicio, fim, descricaoEvento, user, importancia');
$this->db->from('eventos');
$this->db->join('clientes','clientes.ccod = eventos.nomeEvento');
$this->db->where('inicio', '<?php echo date('Y-m-d'); ?>');
$query = $this->db->get();
return $query->result();
}