I have two tables 'clients' and 'famClientes' connected by 'clients_idclientes'
When a client is added, this client can initiate a session where his data appear (until then I have no problem since he creates the session and shows data) the problem that I have is that I have to show all the information of famClientes for example: user1 (with id '3') has 2 people in famClientes.
Controller:
public function logueado() {
if($this->session->userdata('logueado')){
$data = array();
$data['familiares'] = $this->usuario_model->familiares();
$data['usuario'] = $this->session->userdata('usuario');
$this->load->view('admin/inicio', $data);
$this->usuario_model->familiares();
}else{
redirect('login');
}
}
Model
function cliente($idclientes) {
$consulta = $this->db->query('SELECT * FROM clientes WHERE idclientes='.$id);
return $consulta->row();
}
Public function familiares() {
$consulta = $this->db->query('SELECT * FROM famClientes where clientes_idclientes=14');
return $consulta->row();
}
The client_customer = 14 I put it that way to do the test, but it only shows me 1, I need you to show me all of that id