0
I have a table where I save the idaluno and idconcedente, I want to make a select that picks the two ids go in their respective tables and take the alunonome and nomeconcedente. As in the codeigniter?
0
I have a table where I save the idaluno and idconcedente, I want to make a select that picks the two ids go in their respective tables and take the alunonome and nomeconcedente. As in the codeigniter?
0
In your model, you can do it this way:
function get_lista(){
$this->db->select('concendente.nome as nome_concedente, aluno.nome as nome_aluno, tabela.*');
$this->db->join('concendente', 'tabela.idconcendente=concendente.id');
$this->db->join('aluno', 'tabela.idaluno=aluno.id');
return $this->db->get('tabela')->result();
}
In this way, we make two joins, seeking the concrete table and the student table, and in select we define the name of each one.
Thank you, I did as you said and gave the result I wanted.
@davidsonAlves great, only accepts my reply as valid. Thank you! :
Browser other questions tagged codeigniter-3
You are not signed in. Login or sign up in order to post.
Edit the question and put the code you’ve tried to do and where it’s struggling
– rnd_rss