0
Hello, I have the following tables in the database:
- data.
- datos_candidate where the same has several fields and one is the following id_vaga.
When I save a vacancy the same has the id_vacancy, that in the future when a person will register in the vacancy (table data_candidate) saved in the same the id_vacancy and the academic id_concerning the vacancy and the user in question.
Only what will happen if a candidate has several vacancies to which he applied, how do I list those vacancies? Just that as there are several id_vaga regarding the same candidate I do not know how to pass the same to the query. I tried to do the following:
function getMinhasVagas($id_academico){
$id_academico = $this->session->userdata('id_academico');
$this->db
->select("id_vaga")
->from("dados_candidato")
->where('id_academico', $id_academico );
$qr = $this->db->get()->result();
$this->db->select("*")->from("dados_vaga")->where('id_vaga', $qr);
return $teste = $this->db->get()->result();
}
Returns the following error: Unknown column 'Array' in 'Where clause'.
Thank you to all who answer me, have a good day.
I don’t know if I got it wrong, but $qr can have multiple results, in order to access $qr->id_vaga, he had to have used Row(). I think you’re wrong. In case I’m wrong I’m sorry.
– user26552
@Murilo You are right, you must use Row() before you can access the property of the registry. However, I believe he wants only the first result, since he seeks a
id
specific to the wave.– lstonon