IssuesPHP Framework Multiple database connections
The IssuesPHP Framework allows you to connect to up to 12 different databases using PDO; let’s look at some examples.
Multiple database connections
In the `Database.php` file, there is a default connection; if the `DB_NUMBER` constant is left empty or assigned the value 1, it connects to a default database.
define('DB_HOST', 'localhost');define('DB_USERNAME', 'jonathan');define('DB_PASSWORD', 'secret');define('DB_DATABASE', 'test');define('DB_DRIVER', 'mysql');Get IssuesPHP’s stories in your inbox
Join Medium for free to get updates from this writer.
define('DB_NUMBER', '');Connecting a second database:
define('DB_SECOND_HOST', 'localhost');define('DB_SECOND_USERNAME', 'jonathan');define('DB_SECOND_PASSWORD', 'secret');define('DB_SECOND_DATABASE', 'hudemyx');define('DB_SECOND_DRIVER', 'mysql');define('DB_SECOND_NUMBER', '2');This allows you to run queries across up to 12 different MySQL databases, get project








