Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when use the aritmatic command * and + in $this->datatabel->select( ); #125

Open
Daiku88 opened this issue Apr 7, 2017 · 2 comments

Comments

@Daiku88
Copy link

Daiku88 commented Apr 7, 2017

i got error when use igniter in select array when use * and + aritmatik sql

this the code :

function json() {
$this->datatables->select('tj.tj_qty1 * tj.tj_harga1+tj.tj_qty2*tj.tj_harga2+tj.tj_qty3 * tj.tj_harga3 + tj.tj_qty4 * tj.tj_harga4 as total');
$this->datatables->from('tj_detail tj');
$nol = array('0');
$this->datatables->where('tj.status',$nol);
return $this->datatables->generate();

@FayazK
Copy link

FayazK commented Jul 14, 2017

I think this could help
$this->datatables->select('(tj.tj_qty1 * tj.tj_harga1+tj.tj_qty2*tj.tj_harga2+tj.tj_qty3 * tj.tj_harga3 + tj.tj_qty4 * tj.tj_harga4) as total');

@send2dawood
Copy link

Replace the query bellow with this one .
$this->datatables->select('tj.tj_qty1 * tj.tj_harga1+tj.tj_qty2*tj.tj_harga2+tj.tj_qty3 * tj.tj_harga3 + tj.tj_qty4 * tj.tj_harga4 as total',FALSE);
$this->datatables->from('tj_detail tj');
$nol = array('0');
$this->datatables->where('tj.status',$nol);
return $this->datatables->generate();

YOUR QUERY
$this->datatables->select('tj.tj_qty1 * tj.tj_harga1+tj.tj_qty2*tj.tj_harga2+tj.tj_qty3 * tj.tj_harga3 + tj.tj_qty4 * tj.tj_harga4 as total');
$this->datatables->from('tj_detail tj');
$nol = array('0');
$this->datatables->where('tj.status',$nol);
return $this->datatables->generate();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants