I'm trying to get a particular value of a field from the DB. But why i try to get the value it gives me the error:
Message: Undefined index: status_status_id
Part of my controller:
function get_by_id($id = 0){
$data['info'] = $this->Rfetch1_model->getdata_by_id($id);
$r=$data['status_status_id'];
if ($r==0){
//something....
}
My model:
function getdata_by_id($id = 0){
$this->db->where('id',$id);
$sql = $this->db->get('info');
return $sql->result();
}
From my understanding my model will return everything from the 'info' table where id=$id; Then why it cannot get the value of the field status_status_id.