2
My question is how to call some DB information to the printing page of a PHP system, developed in Codeigniter.
In the users' DB "doctor", I have the following tables: 
doctor_id,name,email,password,address,phone,department_id,profile 
The code below calls the doctor’s name, as well as other information from another table, the patient, to the printing page. But, I would like to know how to include, in the same line as the doctor’s name, the information "profile" and "address"?
<?php 
$edit_data = $this->db->get_where('prescription', array('prescription_id' => $param2))->result_array(); 
foreach ($edit_data as $row): 
$patient_info = $this->db->get_where('patient' , array('patient_id' => $row['patient_id'] ))->result_array(); 
?> 
<div id="prescription_print"> 
<div><b><?php $name = $this->db->get_where('doctor' , array('doctor_id' => $row['doctor_id'] ))->row()->name; 
echo 'Drº '.$name;?> </b></div> 
<br> 
<br> 
<br> 
<?php foreach ($patient_info as $row2){ ?> 
<?php echo 'Nome do Paciente: '.$row2['name']; ?><br> 
<br> 
<br> 
<b><?php echo get_phrase('medication'); ?> :</b> 
<p><?php echo $row['medication']; ?></p> 
<br> 
<br> 
<?php } ?> 
<?php echo 'Data: '.date("d M, Y", $row['timestamp']); ?> 
<br> 
</b> 
</div> 
</div> 
<br> 
<a onClick="PrintElem('#prescription_print')" class="btn btn-primary btn-icon icon-left hidden-print"> 
Imprimir Prescrição 
<i class="entypo-doc-text"></i> 
</a> 
<?php endforeach; ?>
We are a community of Portuguese language (European and Brazilian), there is no need to use English (and it is not recommended), because everyone here speaks mostly only Portuguese. -- I changed the title because the problem seems to be in downloading the data and not in printing.
– Guilherme Nascimento
Laravel or Codeigniter?
– gmsantos
Correction! You are in Codeigniter, you are absolutely right! I apologize for the mistakes and thank you for your help. Namaste!
– Kali