Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $username = "123";
- $password = "123";
- $host = "localhost";
- $dbname = "123";
- try {
- $dbh = new PDO('mysql:host=localhost;dbname=123', $username, $password);
- $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- echo "Connected";
- }
- catch(PDOException $e) {
- echo "I'm sorry Charlie, I'm afraid i cant do that.";
- file_put_contents('PDOErrors.txt', $e->getMessage(), FILE_APPEND);
- $dbh = null;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement