Model: Here is my Model i want to get record from department against department id.
<?php
class Functions extends CI_Model{
function getName($table,$column,$id){
$this->db->select($column)->from($table)->where('id',$id);
$query = $this->db->get();
return $query->result_array();
}
}
?>
View:
33) <td><kbd><?php echo $rows['id'];?></kbd></td>
34) <td><?php echo $rows['doctor_name'];?></td>
35) <td><?php echo $this->functions->getName('mansoora_department','department_name',$rows['doctor_department_id']);?></td>
36) <td><?php echo $rows['doctor_nic'];?></td>
Error:
A PHP Error was encountered
Severity: Notice
Message: Array to string conversion
Filename: doctor/index.php
Line Number: 35