I'm am trying to get the sql format below
SELECT * FROM `ci_nest` WHERE `lft` > 9 AND `rgt` < 28 AND `rgt` = `lft` + 1 ORDER BY `lft`
However Codeigniter 3 is inserting the quotes at the wrong place.
My Code as follows
$this->db->where($leftcol . ' > ' . $leftval . ' AND ' . $rightcol . ' < ' . $rightval);
$this->db->where($rightcol . " = " . $leftcol . " +1");
$this->db->order_by($leftcol);
$query = $this->db->get($this->table_name);
What codeigniter query output is
SELECT *
FROM `ci_nest`
WHERE `lft` > 9 AND `rgt` < 28
AND `rgt` = `lft` `+1`
ORDER BY `lft`
As you can see at the line and rgt
= lft
+ 1 is being formatted wrongly by codeigniter 3 query builder.
Any workaround for this issue would be appreciated.