Advertisement
Guest User

Untitled

a guest
Mar 12th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. <?php
  2. $server = 'localhost';
  3. $username = 'root';
  4. $password = 'root';
  5. $database = 'my_db';
  6. $dsn = 'mysql:dbname=my_db;host=localhost;port=3306;charset=utf8';
  7. try{
  8. $conn = new PDO($dsn, $username, $password);
  9. } catch(PDOException $e){
  10. die( "Connection failed: " . $e->getMessage());
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement