Files
WMU-CS4430-Project/var/www/db_connection.php
2019-12-03 22:24:42 -05:00

16 lines
476 B
PHP

<?php
$db_server = "localhost";
$db_name = "friendbook";
$db_username = "web";
$db_password = "Password456";
try{
$db_connection = new PDO("mysql:host=$db_server;dbname=$db_name", $db_username, $db_password);
$db_connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}catch(PDOException $e){
echo "PDOException: ".$e->getMessage();
}catch(Exception $e){
echo "Exception: ".$e->getMessage();
}
?>