I have a challenge for a job and my mission is to perform a CRUD using codeigniter. And in this challenge, I have to make a listing of two MYSQL tables, one with the name "deliverer" and the other "address".
The problem is that I am not able to make the connection in the database with the two tables. I'll show you how my Controller and my Model are.
Model:
public function SelecionaTodos() {
$retorno = $this->db->get('entregador',100); *I NEED TO CONNECT THE DELIVERY TABLE AND ADDRESS *
return $retorno->result();
}
Controller:
public function index() {
$this->load->model('EntregadorModel');
$tabela = $this->EntregadorModel->SelecionaTodos();
$dados = array(
'titulo' => 'Lista de Entregadores',
'tabela' => $tabela,
'pagina' => 'entregador/index.php'
);
$this->load->view('index',$dados);
}