Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $dsn = 'mysql:host=localhost;dbname=MyShop';
- $username = 'root';
- $password = 'root';
- /*
- //Option 1 - without using an error page
- try {
- $db = new PDO($dsn, $username, $password);
- } catch (PDOException $e) {
- echo $e->getMessage();
- exit();
- }
- */
- /*
- //Option 1 - with an error page
- try {
- $db = new PDO($dsn, $username, $password);
- } catch (PDOException $e) {
- $error_message = $e->getMessage();
- include('database_error.php');
- exit();
- }
- */
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement