PHP Function to validate setting

I am rebuilding my dev box as we speak but I am hoping I’ve got the first part right :stuck_out_tongue:

pdo.inc.php

<?php

// Connect to MySQL
$dsn = 'mysql:dbname=dev; host=127.0.0.1';
$user = 'devuser';
$password = 'devpass';

try {
	$dbh = new PDO($dsn, $user, $password);
} catch (PDOException $e) {
	echo 'Failed to connect to MySQL: ' . $e->getMessage();
}

?>
1 Like