I need to get some data from two tables. There are no conditions. But my code returns duplicate data values. each table contains 4 rows
Tbl centers:

TBL Training Course:

Output:

My controller code:
$this->load->model("admindata");
$data ['query'] = $this->admindata->getcentrelist();
$this->load->helper('url');
$this->load->view('admin/header');
$this->load->view('admin/training',$data);
$this->load->view('admin/footer');
My request in the model:
public function getcentrelist()
{
$this->load->database();
$query= $this->db->query('SELECT centre_name,course_name from tbl_training_courses, tbl_traning_centres');
return $query->result();
}
View: (training.php)
<?php foreach($query as $row): ?>
<tr>
<td><?php echo $row->centre_name; ?></td>
</tr>
<?php endforeach; ?>
source
share