forked from nisiya/MaristIDCP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconnect_db.php
40 lines (27 loc) · 1.07 KB
/
connect_db.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
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/*// A simple PHP script demonstrating how to connect to MySQL.
// Press the 'Run' button on the top to start the web server,
// then click the URL that is emitted to the Output tab of the console.
//$servername = getenv('10.10.7.88');
//$username = getenv('Ni');
//$password = "student";
//$database = "IDCP";
//$dbport = 3306;
// Create connection
// $dbc = @mysqli('10.10.7.88', 'Ni', 'student', 'IDCP');
$dbc = @mysqli('localhost', 'root', '', 'idcp');
// Check connection
if ($dbc->connect_error) {
die("Connection failed: " . $dbc->connect_error);
}
echo "Connected successfully (".$dbc->host_info.")";*/
?>
<?php
# CONNECT TO MySQL DATABASE.
# Connect on 'localhost' for user 'mike' with password 'easysteps' to database 'site_db'.
# Otherwise fail gracefully and explain the error.
$dbc = @mysqli_connect ( 'localhost', 'root', '', 'idcp' )
OR die ( mysqli_connect_error() ) ;
# Set encoding to match PHP script encoding.
mysqli_set_charset( $dbc, 'utf8' ) ;
?>