Welcome Guest, Not a member yet? Register   Sign In
CI4 what to use instead of db_select
#1

With CI3 when I needed to change the database name and not the connection I could use:

PHP Code:
$this->db->db_select('DB_NAME'); 


How can I do the same thing in CI4?
Reply
#2

$db->setDatabase($database2_name);
https://codeigniter4.github.io/userguide...etdatabase
Reply
#3

(03-09-2022, 03:04 AM)kenjis Wrote: $db->setDatabase($database2_name);
https://codeigniter4.github.io/userguide...etdatabase

Perfect, I missed it in the documentation, thanks
Reply




Theme © iAndrew 2016 - Forum software by © MyBB