CodeIgniter Forums
Migration 2 -> 4 : database - Printable Version

+- CodeIgniter Forums (
+-- Forum: CodeIgniter 4 (
+--- Forum: CodeIgniter 4 Support (
+--- Thread: Migration 2 -> 4 : database (/showthread.php?tid=75903)

Migration 2 -> 4 : database - lama - 03-28-2020


I'm looking for a migration of CI2 to CI4... Well i know ... Angel

Is there a simple way to keep the database queries "as is" from CI2 in CI4 ?

For example, what I wrote in my CI2 application :
PHP Code:
$this->db->select('products.products_id, products_name, products_uri, products_ean, products_image_type, products_price, products_stock_quantity');
$this->db->join('products_stock''products.products_id = products_stock.products_id');
$this->db->where('products_image_type !=''none');
$query $this->db->get();

I want to rewrite less as possible because if an application with a huge amount of database manipulation .. Confused


RE: Migration 2 -> 4 : database - MGatner - 03-30-2020

There is not an easy way to do this. If you have such a large amount you may be able to write your own class and load the database builder into its $db property, but some of the methods have changed so it would still involve some manipulation.