CodeIgniter Forums
Join with calculation - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: Join with calculation (/thread-62348.html)



Join with calculation - Petrusilius - 07-04-2015

After upgrading from CI 2.x.x to CI 3.0.0 i've got several problems, and some of them i could fix and i understood why it was changed. But i'm not sure if i found a bug at this problem:

I'm doing a select statement and having the following kind of a join:

->join('table', 'table.x = (y - z)')

I've changed the variables to letters, because their content doesn't matter. CI framework is converting this to the following snippet:

JOIN `table` ON `table`.`x` = (`y-` `z)`

But it should convert it to the following snippet:

JOIN `table` ON `table`.`x` = (`y`-`z`)

So it's a bug or do i have to change sth. for CI 3.0.0?

Thanks in advance.


RE: Join with calculation - mistergg - 07-08-2015

(07-04-2015, 02:59 PM)Petrusilius Wrote: After upgrading from CI 2.x.x to CI 3.0.0 i've got several problems, and some of them i could fix and i understood why it was changed. But i'm not sure if i found a bug at this problem:

I'm doing a select statement and having the following kind of a join:

->join('table', 'table.x = (y - z)')

I've changed the variables to letters, because their content doesn't matter. CI framework is converting this to the following snippet:

JOIN `table` ON `table`.`x` = (`y-` `z)`

But it should convert it to the following snippet:

JOIN `table` ON `table`.`x` = (`y`-`z`)

So it's a bug or do i have to change sth. for CI 3.0.0?

Thanks in advance.

Hello,

try

Code:
->join('table', 'table.x = (y - z)', FALSE)

This will disable escaping