Guest User

Untitled

a guest
Jan 18th, 2019
67
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. define( 'DB_HOST', 'localhost' );
  3. define( 'DB_PORT', '3306' );
  4. define( 'DB_NAME', 'db' );
  5. define( 'DB_USER', 'user' );
  6. define( 'DB_PASS', 'password' );
  7.  
  8. try
  9. {
  10. $conn_str = sprintf( 'mysql:host=%s;dbname=%s', DB_HOST, DB_NAME );
  11. $PDO = new PDO( $conn_str, DB_USER, DB_PASS );
  12. }
  13. catch ( PDOException $e )
  14. {
  15. print "Error!: " . $e->getMessage() . "<br/>";
  16. die();
  17. }
RAW Paste Data