db->select('*'); $this->db->from('testimonial'); if($id!=0){$this->db->where(array('id'=>$id));} $query = $this->db->get(); //echo $this->db->last_query();exit; return $query; } }