[eluser]NeoArc[/eluser]
Try this, if no data is found you wont get errors in the view.
Code:
function get_tickets2()
{
$data = array(); //default value
$sql = "SELECT ref_code, ref_desc FROM prob_ref WHERE tab_code = ?";
$q = $this->db->query($sql, array('APPN'));
if($q->num_rows())
{
$data = $q->result();
}
return $data;
}