Guest User

Untitled

a guest
Apr 16th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.40 KB | None | 0 0
  1. <?php
  2. //Stellt die Datenbankverbindung her
  3. /*** mysql hostname ***/
  4. $hostname = 'localhost';
  5.  
  6. /*** mysql username ***/
  7. $username = 'user';
  8.  
  9. /*** mysql password ***/
  10. $password = 'pw';
  11.  
  12. /*** mysql db-name ***/
  13. $dbname = 'dbname';
  14.  
  15. try {
  16.     $dbh = new PDO("mysql:host=$hostname;dbname=$dbname", $username, $password);
  17.     }
  18. catch(PDOException $e)
  19.     {
  20.     echo $e->getMessage();
  21.     }
  22. ?>
Add Comment
Please, Sign In to add comment