I have two customer tables, one called personalization and another called personalization I need to load both tables within 1 (a select) using php and codeigniter 3.6.
To load the personalization table, as follows the code in the controller and view below, remembering that the Attendance table has the foreign keys of the personal table (fkcodpf) and the personal table (fkcodpj):
CONTROLLER Attendance
class Atendimento extends CI_Controller {
public function cadastro() {
$dados['pessoafisica'] = $this->db->get('pessoafisica')->result();
$this->load->view('includes/html_header');
$this->load->view('includes/menu');
$this->load->view('cadastrar/cad_atendimento', $dados);
}
}
Call Signup VIEW (select)
<label>Nome do Cliente</label>
<select id="fkcodpf" name="fkcodpf" class="form-control" >
<option value=""></option>
<?php foreach ($pessoafisica as $pf) { ?>
<option value="<?= $pf->codpf ?>"> <?= $pf->nomepessoafisica; ?></option>
<?php } ?>
</select>
But how do you load together in this select, the personajuridica table? If possible by ordering the personal name, followed by the personal name?