Codeigniter datatables query not working?
<p>I am using codeigniter 2.0 version. In datatables query not working using datatable method. But when i run this in mysql means it is perfectly working. I dont know how to solve this issue. Below i have given my query,</p>

<pre><code>$this-&gt;load-&gt;library('datatables'); 
            $this-&gt;datatables-&gt;query("select sales.id as id, sales.date as date, sales.customer_name, sale_items.product_name as pname, sales.depositcard_amt as debit, 0 as credit from sales join sale_items on sale_items.sale_id=sales.id where sales.customer_id = $user and sales.branch_id=$branchid and sales.depositcard_amt != 0.00 group by sales.id UNION ALL select deposit.id as id, deposit.credit_on as date, deposit_details.customer_name, deposit_details.package_name as pname, 0 as debit, deposit.total_amount as credit from deposit join deposit_details on deposit_details.deposit_id=deposit.id where deposit.customers=$user"); 

        $this-&gt;datatables-&gt;add_column("Actions", 
            "&lt;center&gt;&lt;/center&gt;", "id")
        -&gt;unset_column('id');

       echo $this-&gt;datatables-&gt;generate();
</code></pre>

<p>Please give any ideas to solve this. Thanks in advance.</p>