結果セットを返すためにcodeigniterに問題があります。私の選択で1つの列を避けるとき、結果は正しいです。 しかし、私は列(説明)を含める場合、私はエラーが発生し、私の結果セットが壊れています。誰でもこの問題の解決方法を知っています。この列には、&のような文字を含むレコードがあります。 '/ ...これは問題を引き起こすと思うかもしれません。Codeigniter:不正な列に起因する非オブジェクトのメンバー関数result_array()を呼び出しますか?
いくつかの詳細:
'char_set' => 'UTF-8',
'dbcollat' => 'Latin1_General_100_CS_AS',
私はすでに成功せず、これらのパラメータを変更しようとしました。
EDITコードの追加:
getおよびget_by関数。コントローラで
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);
}
機能:
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);
}
同様にあなたのコードを追加し –
人々はあなたが追加 –
を支援することは不可能ですcode..otherwiseを追加します。コード。コードなしで人々があなたを助けることはできません –