![]() |
Codeigniter 4 like query issue - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Codeigniter 4 like query issue (/showthread.php?tid=85932) |
Codeigniter 4 like query issue - versioningsolutions - 12-21-2022 I am not sure that having issue in CodeIgniter 4 or not but I am getting issue to show two times db prefix in query while I use Like. Following is my query. mysqli_sql_exception #1054 $order_status_ids = [14, 21]; $builder = $this->db1->table('order'); $builder->join('order_product', 'order.order_id = order_product.order_id','LEFT'); $builder->Like('order_product.name', $_GET['query']); $builder->whereIn('order.order_status_id', $order_status_ids); $query = $builder->get(); return $query->getResultArray(); Showing query like as below. "ssiegel_" is my db prefix. I am using multi database connection. As you can see that adding two times prefix in like condition [ssiegel_``ssiegel_order_product.name LIKE ] SELECT * FROM ssiegel_order LEFT JOIN ssiegel_order_product ON ssiegel_order.order_id = ssiegel_order_product.order_id WHERE ssiegel_``ssiegel_order_product.name LIKE '%Apple Fiber Powder%' ESCAPE '!' AND ssiegel_order.order_status_id IN (14,21) Any one have solution for this issue or any updates in CodeIgniter 4 to update library. Thanks in advance! RE: Codeigniter 4 like query issue - kenjis - 12-22-2022 The bug was fixed in v4.2.0. https://github.com/codeigniter4/CodeIgniter4/pull/5778 I recommend you upgrade to the latest v4.2.11. |