Guest User

Untitled

a guest
Feb 7th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. <?php
  2. $db_host = "localhost";
  3. $db_name = "";
  4. $db_user = "";
  5. $db_pass = "secret";
  6. $utf8 = "utf8";
  7. try{
  8.  
  9. $pdo = new PDO("mysql:host={$db_host};dbname={$db_name};charset={$utf8}",$db_user,$db_pass);
  10. $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  11. }
  12. catch(PDOException $e){
  13. echo $e->getMessage();
  14. }
  15. ?>
Add Comment
Please, Sign In to add comment