I'm having an issue in codeigniter to return a result set. When I'm avoiding 1 column in my select, the result is correct. But when i want to include the column (description) then i get the error and my result-set is corrupt. Anyone knows how to solve this issue. The column has soms records with characters like &,'/... I might think that this causes the problem.
some details:
'char_set' => 'UTF-8',
'dbcollat' => 'Latin1_General_100_CS_AS',
I already tried to change these parameters without success.
EDIT Code added:
get and get_by function.
public function get($id = NULL, $single = FALSE) {
if($id != NULL){
$this->db->where($this->_primary_key, $id);
$method = 'row';
}
elseif($single == TRUE){
$method = 'row';
}
else{
$method = 'result';
}
if($_order_by != ''){
if(!count($this->db->ar_orderby)){
$this->db->order_by($this->_order_by);
}
}
//$query = $this->db->query("Select Description from items WHERE Company = 'MINITFR'");
// $array = $query->result_array();
// return 'test';
// var_dump($this->db->get_compiled_select($this->_table_name));
return $this->db->get($this->_table_name)->result_array();
// return $this->db->get($this->_table_name)->$method();
}
public function get_by($where, $single = FALSE) {
$this->db->where($where);
return $this->get(NULL,$single);
}
function in controller:
public function show_items(){
$this->load->model('item_m');
$this->data['ajax_req'] = TRUE;
$where = "Company = '".$this->session->userdata('company')."'";
$this->data['item_list'] = $this->item_m->get_by($where,FALSE);
$this->load->view('pages/details/components/item_list', $this->data);
}