Welcome Guest, Not a member yet? Register   Sign In
Migration 2 -> 4 : database
#1

Hello,

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->from('products');
$this->db->join('products_stock''products.products_id = products_stock.products_id');
$this->db->where('products_is_displayed'1);
$this->db->where('products_image_type !=''none');
$this->db->order_by('products_time_add''desc');
$this->db->limit($limit);
$query $this->db->get();
return 
$query->result_array(); 


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

Thanks
Reply
#2

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.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB