r-tk / rtk-db
RTK DB
Installs: 22
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/r-tk/rtk-db
Requires (Dev)
This package is auto-updated.
Last update: 2025-10-08 17:59:31 UTC
README
DB connections manager with some unifying between adapters
Define connection
use RTK\DB\DB; DB::addInstance('default', array( 'type' => 'mysqli', 'host' => 'localhost', 'user' => 'root', 'password' => '', 'database' => 'test', )); // or DB::addInstance('default', array( 'type' => 'PDOMysql', 'host' => 'localhost', 'user' => 'root', 'password' => '', 'database' => 'test', )); // or DB::addInstance('default', array( 'type' => 'PDOMysql', 'dsn' => 'mysql:dbname=test;host=localhost', 'user' => 'root', 'password' => '', ));
Get connection instance
use RTK\DB\DB; $db = DB::get('default'); // omitting instance name will return instance 'default' $db = DB::get();