Объединить таблицы

Вывод

База данных

Контроллер (это не полный код контроллера)
public function entregas_lista($idCarga) {
$crud->where('entregas.idCitas =', $idCarga);
$query = $this->Intervalos_Model->get_idintervalo();
if ($crud->getState() == "add") {
$crud->change_field_type('idCitas', 'hidden', $idCarga);
$crud->change_field_type('idIntervaloHorario', 'hidden', $query);
}
$output = $crud->render();
$this->_example_output($output);
Функция модели (пытается получить максимальный идентификатор)
public function get_idintervalo() {
$qry = $this->db->select('MAX(idIntervaloHorario)')
->from('intervaloshorarios')
->get();
if ($qry->num_rows() > 0){
return $qry->row_array();
}
return FALSE;
}
Подробнее здесь: https://stackoverflow.com/questions/440 ... of-the-row
Мобильная версия