Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once 'config.php';
- function connect($host, $db, $user, $password) {
- $dsn = "mysql:host=$host;dbname=$db;charset=UTF8";
- try {
- $options = [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION];
- return new PDO($dsn, $user, $password, $options);
- } catch (PDOException $e) {
- die($e->getMessage());
- }
- }
- return connect($host, $db, $user, $password);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement