I was able to successfully fetch data in the following table. However, in the 'Class Teacher' column, I want the teacher name instead of the teacher id (foreign key)

This is the database table
Here is how I fetch data in the class view
if( !empty($class_data) ) {
foreach ($class_data AS $row) {
?>
<tr>
<td><?php echo $row->class_id; ?></td>
<td><?php echo $row->grade; ?> </td>
<td><?php echo $row->name; ?></td>
<td><?php echo $row->capacity; ?></td>
<td> <?php echo $row->teacher_id; ?></td>
my controller
function index()
{
$teacher_data= $this->Tableview_model->fetch_teacher_data();
$class_data = $this->Tableview_model->fetch_class_data();
$data["teacher_data"] = $teacher_data;
$data["class_data"] = $class_data;
$this->load->view('classes',$data);
}
function add_class()
{
$class_data = array(
'class_id' => '',
'grade' => $this->input->post('grade'),
'name' => $this->input->post('class_name'),
'capacity' => $this->input->post('capacity'),
'teacher_id' => $this->input->post('class_teacher'),
);
$insert = $this->Model_Action->insertTable('class',$class_data);
echo json_encode(array("status" => TRUE));
}
teacher database table
CREATE TABLE
teacher(teacher_idint(11) NOT NULL AUTO_INCREMENT,t_f_namevarchar(250) NOT NULL,t_last_namevarchar(250) NOT NULL,DOBdate NOT NULL,t_emailvarchar(250) NOT NULL,t_addressvarchar(500) NOT NULL,t_telvarchar(150) NOT NULL,t_usernamevarchar(250) NOT NULL,t_passwordvarchar(500) NOT NULL,qualificationsvarchar(5000) NOT NULL,t_date_of_joindate NOT NULL,t_date_of_leavingdate NOT NULL,t_current_statusint(1) NOT NULL, PRIMARY KEY (teacher_id) ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1
Model fetch_class_data function
function fetch_class_data()
{
$this->db->select("*");
$this->db->from('class');
$query=$this->db->get();
if($query->num_rows() > 0)
{
return $query->result();
}else{
return false;
}
}

teacherstable structure and model function code?