-
Notifications
You must be signed in to change notification settings - Fork 0
/
connect.php
28 lines (22 loc) · 1 KB
/
connect.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
// This file is used to connect the website with databse
// For time being all websites and queries pass through this user
// This user act as DBA and has all previlleges granted
//Please import the databse to SQL before attempting to connect
// START THE SESSION
session_start();
$servername = "localhost";
$username = "root"; // For MYSQL the predifined username is root
$password = ""; // For MYSQL the predifined password is " "(blank)
$dbname = "bank"; // Database Name
define('SITEURL','localhost/bank/');
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
//PHP nl2br() function which inserts HTML line breaks before all newlines in a string.
// /r/n is also used for new line
echo nl2br("\r\nPlease start your SQL server and check again\r\n\r\n");
die("Connection failed: " . $conn->connect_error);
}
?>