Welcome Guest, Not a member yet? Register   Sign In
DISTINCT Does not work as a keyword in codeigniter....
#8

[eluser]aquary[/eluser]
What version of CI you are using? I remember in the old version I cannot use result() directly if there is no data.

Try this one and let see what are returned:

Code:
function getdetaildatabyid($id)
{
  $data=$this->db->select(“DISTINC contact_details_id,contact_id,contact_value”, FALSE)
     ->from(“tbl_contact_details”)
     ->where(“tbl_contact_details.contact_id”,$id)
     ->get();
  var_dump($data);
  // Maybe you could use these commented lines instead.
  // if($data->num_rows()>0)
  //    return $data->result();
  // else
  //    return array();
  return $data->result();
}


Messages In This Thread
DISTINCT Does not work as a keyword in codeigniter.... - by El Forum - 02-25-2012, 02:12 AM
DISTINCT Does not work as a keyword in codeigniter.... - by El Forum - 02-25-2012, 02:30 AM
DISTINCT Does not work as a keyword in codeigniter.... - by El Forum - 02-25-2012, 02:35 AM
DISTINCT Does not work as a keyword in codeigniter.... - by El Forum - 02-25-2012, 03:05 AM
DISTINCT Does not work as a keyword in codeigniter.... - by El Forum - 02-25-2012, 03:52 AM
DISTINCT Does not work as a keyword in codeigniter.... - by El Forum - 02-25-2012, 04:49 AM
DISTINCT Does not work as a keyword in codeigniter.... - by El Forum - 02-25-2012, 05:35 AM
DISTINCT Does not work as a keyword in codeigniter.... - by El Forum - 02-25-2012, 05:41 AM
DISTINCT Does not work as a keyword in codeigniter.... - by El Forum - 02-25-2012, 05:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB