Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $username = "root"; //your username
- $password = "root"; // your PW
- try {
- $conn = new PDO("mysql:host=$servername;port=3307;dbname=test", $username, $password);
- // set the PDO error mode to exception
- $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- } catch (PDOException $e) {
- echo "Connection failed: " . $e -> getMessage();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement