Codeigniter activerecord查询连续运行

时间:2014-06-14 02:55:22

标签: php codeigniter activerecord mysqli-multi-query

当我尝试运行跟随查询时,它永远不会返回任何内容,它只是继续运行。我做错了什么?

$this->db->distinct('customer.Name')
                    ->from('customer')
                    ->from('invoicelinedetail')
                    ->from('invoice')
                    ->from('iteminventory')
                    ->where('invoice.CustomerRef_ListID = customer.ListID')
                    ->where('invoicelinedetail.IDKEY = invoice.TxnID')
                    ->where('invoicelinedetail.ItemRef_ListID =', $id)
                    ->order_by('customer.Name', 'desc');
$query = $this->db->get();

1 个答案:

答案 0 :(得分:0)

$this->db->get();后,您需要检索结果

More info from CI Docs

为此,请将$query=设置为以下之一:

$this->db->result_array(); //returns array
$this->db->row_array(); //returns single row as array

$this->db->result(); //returns object
$this->db->row(); //returns single row as object