Welcome Guest, Not a member yet? Register   Sign In
Switch Sqlite3 DB - $db->setDatabase
#2

You need to create a config like below:

PHP Code:
$custom = [
    'DSN'      => '',
    'hostname' => 'localhost',
    'username' => '',
    'password' => '',
    'database' => '',
    'DBDriver' => 'MySQLi',
    'DBPrefix' => '',
    'pConnect' => false,
    'DBDebug'  => (ENVIRONMENT !== 'production'),
    'cacheOn'  => false,
    'cacheDir' => '',
    'charset'  => 'utf8',
    'DBCollat' => 'utf8_general_ci',
    'swapPre'  => '',
    'encrypt'  => false,
    'compress' => false,
    'strictOn' => false,
    'failover' => [],
    'port'     => 3306,
];

$db = \Config\Database::connect($custom); 

Fill in the Custom config above with your information.

Then the line below it. If the custom config is correct it should work.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
Switch Sqlite3 DB - $db->setDatabase - by s4f3r - 08-13-2020, 05:31 AM
RE: Switch Sqlite3 DB - $db->setDatabase - by InsiteFX - 08-13-2020, 10:40 AM



Theme © iAndrew 2016 - Forum software by © MyBB