Created
November 1, 2015 19:26
-
-
Save VictorFursa/5286d30e1a9d37ca19c1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
try | |
{ | |
$pdo = new PDO("mysql:host=localhost;dbname=joke_db", "root", ""); | |
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); | |
$pdo->exec('SET NAMES "utf8"'); | |
} | |
catch (PDOException $e) | |
{ | |
$output = 'Невозможно подключиться к серверу баз данных :('. " <br>" .$e->getMessage(); | |
include_once 'output.php'; | |
exit(); | |
} | |
//$output = 'Соединение с базой данных установлено :) '; | |
include_once 'output.php'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment