-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConn.php
56 lines (40 loc) · 1 KB
/
Conn.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
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
// error_reporting(E_ALL);
// ini_set('display_errors', 'On');
require_once(__DIR__ . '/wp-config.php');
class DbInterface
{
var $conn;
function __construct()
{
$servername = DB_HOST;
$username = DB_USER;
$password = DB_PASSWORD;
$database = DB_NAME;
$this->conn = new mysqli($servername, $username, $password, $database);
// Check connection
if ($this->conn->connect_error) {
die("Connection failed: " . $this->conn->connect_error);
}
}
function GetConnectionObj()
{
return $this->conn;
}
//echo "Connected successfully";
function getTable($sql)
{
$result = $this->conn->query($sql);
return $result;
}
//<!--start update 19-feb-2019-->
function ExecuteMultipleQuery($sql)
{
$result = mysqli_multi_query($this->conn, $sql);
return $result;
}
//<!--end update 19-feb-2019-->
function getTableList($sql)
{
}
}