title: MySql query working in PHPmyadmin, but not working in codeigniter
body: <p>i am working in codeigniter project when i try to get datas from database using 5 tables in a single query.</p>
  
  <p>In phpmyadmin sql query works fine but codeigniter query not working.</p>
  
  <p><strong>My Phpmyadmin Query :</strong></p>
  
  <pre><code>select sma_sales.date, sma_sales.reference_no, biller, sma_companies.name as DeliveryRep,customer,c.code, 
  GROUP_CONCAT(CONCAT(sma_sale_items.product_name, ' (', sma_sale_items.quantity, ')') SEPARATOR '\n') as iname, 
  grand_total, paid, sma_payments.amount as pyname, 
  payment_status
  from sma_sales
  left outer join sma_sale_items on sma_sale_items.sale_id=sma_sales.id
  left outer join sma_companies on sma_companies.id=sma_sales.delivered_id
  left outer join sma_companies as c on c.id=sma_sales.customer_id
  left outer join sma_warehouses on sma_warehouses.id=sma_sales.warehouse_id
  left outer join sma_payments on sma_payments.sale_id=sma_sales.id
  group by sma_sales.id
  </code></pre>
  
  <p><strong>My Codeigniter query:</strong></p>
  
  <pre><code>-&gt;select("date, reference_no, biller, companies.name as DeliveryRep,customer,c.code, "
                          . "GROUP_CONCAT(CONCAT(" . $this-&gt;db-&gt;dbprefix('sale_items') . ".product_name,"
                          . " ' (', " . $this-&gt;db-&gt;dbprefix('sale_items') . ".quantity, ')') SEPARATOR '\n') as iname,"
                          . " grand_total, paid,payments.amount as pyname, payment_status", FALSE)
                  -&gt;from('sales')
                  -&gt;join('sale_items', 'sale_items.sale_id=sales.id', 'left')
                  -&gt;join('companies', 'companies.id=sales.delivered_id', 'left')
                  -&gt;join('companies as c', 'c.id=sales.customer_id', 'left')
                  -&gt;join('warehouses', 'warehouses.id=sales.warehouse_id', 'left')
                  -&gt;join('payments', 'payments.sale_id=sales.id', 'left')
                  -&gt;group_by('sales.id')
  $q = $this-&gt;db-&gt;get();
  </code></pre>
  
  <p><strong>sma  nothing but database prefix</strong></p>