I need to connect to a DB that's name will be entered in the URL. For Example the URL will be
So the DB I need to connect to is 'comp'.
Is there a way to do this without defining each database in the database.php config file?
define('COMP', $this -> uri -> segment(1));
'database' => 'tm_'.COMP,
The above gives me an error about the $this, so I am not completely sure where I can define the COMP variable where the database config file can read it.