Code:
function setupDatabase()
{
// put your database information mentioned above here
$username = 'root';
$password = 'root';
$host = 'localhost';
$dbname = 'verify';
try {
$pdo = new PDO("mysql:host=$host;dbname=$dbname",$username,$password);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch(PDOException $e) {
return 'ERROR: ' . $e->getMessage();
}
return $pdo;
}