Location: PHPKode > scripts > Persist Class > persist-class/demo1-connection.php
<?php

require('persistclass/PersistClass.php');

// create a database connection
$myConnection = new DbConnectionMysql();
$myConnection->connect('localhost', 'demouser', 'demopassword', 'demodatabase');

// register connection into DbConnectionPool
DbConnectionPool::instance()->registerConnection($myConnection);

echo 'Successfully connected to database';

?>
Return current item: Persist Class