Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $dbname = "site34php";
- $username = "root";
- $password = "";
- try {
- $darn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
- $darn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- echo "Connected successfully";
- }
- catch(PDOException $e) {
- echo "Connection failed: " . $e->getMessage();
- }
- $darn = null;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement