Andronicuszeno

db_connection.php

Apr 5th, 2016
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.71 KB | None | 0 0
  1. <?php
  2. // Database connection
  3.  
  4.   // Database global constants
  5.   /*
  6.   defined('DB_SERVER') ? null : define("DB_SERVER", "localhost");
  7.   defined('DB_USER') ? null : define("DB_USER", "database_user");
  8.   defined('DB_PASS') ? null : define("DB_PASS", "database_password");
  9.   defined('DB_NAME') ? null : define("DB_NAME", "database_name");
  10.   */
  11.  
  12.   $server = "localhost";
  13.   $user = "database_user";
  14.   $password = "database_password";
  15.   $dbname = "database_name";
  16.  
  17.  
  18.  
  19.   // Test if connection succeeded
  20.   if($db_connection->connect_errno()) {
  21.     die("Database connection failed: " .
  22.          $db_connection->connect_error() .
  23.          " (" . $db_connection->connect_errno() . ")"
  24.     );
  25.   }
  26.  
  27.  
  28.  
  29.  
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment