Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Sebastian Andersen
Added: May 11, 2018 5:17 AM
Modified: May 11, 2018 5:28 AM
Views: 25
Tags: no tags
  1. $dbn = "DBNAMEHERE";
  2. $dbh = "ADDRESSHERE";
  3. $dbu = "USERNAMEHERE";
  4. $dbp = "PASSWORDHERE";
  5.  
  6. try {
  7.         $dbc = new PDO("mysql:dbname={$dbn};host={$dbh}", $dbu, $dbp);
  8. } catch (PDOException $e) {
  9.         echo "Connection failed: " . $e->getMessage();
  10. }