我想使用SUBSTRING_INDEX加入codeigniter但它不起作用
如下面的代码,如何更正? 我想使用此代码在 In_no
中选择我的数据库和关节的两个表In_no 的值不同:
表invoice_all中的in_no值为ISP1501-n +和IP1501-n +
表 add_val 中 值 in_no 为<+>当我在codeigniter
上加载视图时,我得到了空白页面<?php
class Report_m extends MY_Model{
public function __construct(){
parent::__construct();
}
public function select_in_completed(){
$this->db->select('*');
$this->db->from('add_val');
$this->db->join('invoice_all','SUBSTRING_INDEX(invoice_all.in_no,'-', -1) = add_val.in_no');
$this->query = $this->db->get();
if($this->query->num_rows()>0){
return $this->query->result();
}
}
}
但是,当我使用 $ this-&gt; output-&gt; enable_profiler(TRUE); 时,Codeigniter会向我显示如下图像
请帮忙。