16 lines
476 B
PHP
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();
|
|
}
|
|
?>
|