Hello, I have the following case, I have a donor who wants to make a donation at a hemocenter, he does the search for this hemocenter and clicks a button I want to donate here. This will create a table in the database called donation_marked, with data: donor_id, middle_id, shift, date_possible_date . Now when I log into the hemocenter on the home screen should appear the data from the donor table that is equal to the donor id of the donation_marked table, in addition to the other data in the donation table marked. But only the donor data is showing up. Follow my select.
$status = 'Aguardando Confirmação';
$this->db
->select("*")
->from("doacao_marcada")
->where('status_doacao_marcada', $status)
->where('id_hemocentro', $this->session->userdata('id_hemocentro'));
$query = $this->db->get()->result();
foreach ($query as $row) {
$this->db->select("*")
->from("doador")
->where("id_doador", $row->id_doador);
return $this->db->get()->result();
}