Guest User

connection.php

a guest
Mar 8th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.37 KB | None | 0 0
  1. <?php
  2.  
  3.     $dbhost = "localhost";
  4.     $dbuser = "root";
  5.     $dbpass = "";
  6.     $dbname = "demo";
  7.  
  8.     $conn = new mysqli($dbhost, $dbuser, $dbpass, $dbname);
  9.  
  10.     $db_connected;
  11.  
  12.     if($conn->connect_error) {
  13.         echo "Database does not exist <br \><br \>";
  14.         return false;
  15.     } else {
  16.         echo "Database exists and is connected <br \><br \>";
  17.         return true;
  18.     }
  19.  
  20.     echo $db_connected;
  21.  
  22. ?>
Add Comment
Please, Sign In to add comment