I have 2 different tables with same columnname name tbl_specialty and tbl_student. I made a JOIN statement to join the 2 tables, now i want to output column name for table 1 and column name for table 2, how can i achieve this ? i am only getting a replication from one column. Please help.
My View
<?php
foreach ($delegates->result() as $row )
{?>
<tr>
<td><a href=""> <?php echo $row->name; ?></a></td>
<td class="center"><?php echo $row->job; ?></td>
<td class="center"><?php echo $row->name; ?></td>
<td class="center"><?php echo $row->workplace;?></td>
<td class="center"><?php echo $row->country_name; ?></td>
</tr>
My model
public function delegates_per_course() {
$this>db>select('tbl_student.name,tbl_student.workplace,tbl_student.job,tbl_student.dob,tbl_student.email,tbl_student.mobile,tbl_country.country_name,tbl_specialty.name,tbl_country.country_id,tbl_country.country_name');
$this->db->from('tbl_student');
$this->db->join('tbl_country','tbl_student.country_id=tbl_country.country_id');
$this->db->join('tbl_specialty','tbl_student.specialty_id=tbl_specialty.id');
$this->db->order_by("tbl_country.country_name");
$query = $this->db->get();
return $query;
}