Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host = 'localhost'; // 127.0.0.1
- $user = 'root';
- $pass = '';
- $port = "3306";
- $db = 'school';
- $charset = 'utf8mb4';
- $dsn = "mysql:host=$host;dbname=$db;charset=$charset;port=$port";
- try {
- $pdo = new PDO($dsn, $user, $pass);
- echo "Success";
- } catch (PDOException $e) {
- die("Problem connecting to database");
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement