Welcome Guest, Not a member yet? Register   Sign In
Database Connection Check
#2

you can do this sort of thing:

$db2 = \Config\Database::connect('custom');
$t= \Config\Database::getConnections();
print_r($t);

output of print_r($t) is:

Code:
Array ( [custom] => CodeIgniter\Database\SQLite3\Connection Object ( [DBDriver] => SQLite3 [escapeChar] => ` [_random_keyword:protected] => Array ( [0] => RANDOM() ) [DSN:protected] => [port:protected] => 3306 [hostname:protected] => localhost [username:protected] => [password:protected] => [database:protected] => /var/www/htdocs/andrinaPerfectBeauty/writable/Art2 [subdriver:protected] => [DBPrefix:protected] => [pConnect:protected] => [DBDebug:protected] => 1 [cacheOn:protected] => [cacheDir:protected] => [charset:protected] => utf8 [DBCollat:protected] => utf8_general_ci [swapPre:protected] => [encrypt:protected] => [compress:protected] => [strictOn:protected] => [failover:protected] => Array ( ) [lastQuery:protected] => [connID] => [resultID] => [protectIdentifiers] => 1 [reservedIdentifiers:protected] => Array ( [0] => * ) [likeEscapeStr] => ESCAPE '%s' [likeEscapeChar] => ! [dataCache] => Array ( ) [connectTime:protected] => [connectDuration:protected] => [pretend:protected] => [transEnabled] => 1 [transStrict] => 1 [transDepth:protected] => 0 [transStatus:protected] => 1 [transFailure:protected] => [aliasedTables:protected] => Array ( ) ) )
Reply


Messages In This Thread
Database Connection Check - by alimotiwala97 - 01-03-2021, 02:56 AM
RE: Database Connection Check - by captain-sensible - 01-04-2021, 04:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB