require_once 'Doctrine/Doctrine.php'; spl_autoload_register(array('Doctrine', 'autoload')); Doctrine_Manager::connection('mysql://username:password@localhost/mydatabase', 'myconnection');
Doctrine_Manager::connection('postgresql://username:password@localhost/myotherdatabase', 'myconnection');In this example, a new connection is created to a PostgreSQL database and is associated with the same 'myconnection' name. This is useful if you need to switch databases based on the environment or user. Package/Library: Doctrine ORM library.