-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlink.php
More file actions
56 lines (23 loc) · 757 Bytes
/
link.php
File metadata and controls
56 lines (23 loc) · 757 Bytes
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
$localhost = 'dbhome.cs.nctu.edu.tw';
$my_user = 'lypan_cs';
$my_password = 'admin';
$my_db = 'lypan_cs';
$mysqli = new mysqli($localhost, $my_user, $my_password, $my_db);
/*
* This is the "official" OO way to do it,
* BUT $connect_error was broken until PHP 5.2.9 and 5.3.0.
*/
if ($mysqli->connect_error) {
die('Connect Error (' . $mysqli->connect_errno . ') '
. $mysqli->connect_error);
}
/*
* Use this instead of $connect_error if you need to ensure
* compatibility with PHP versions prior to 5.2.9 and 5.3.0.
*/
if (mysqli_connect_error()) {
die('Connect Error (' . mysqli_connect_errno() . ') '
. mysqli_connect_error());
}
//echo 'Success... ' . $mysqli->host_info . "\n";