forked from kurtcoke/DemonHunter_Exploitkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsql.php
More file actions
83 lines (63 loc) · 1.92 KB
/
Copy pathsql.php
File metadata and controls
83 lines (63 loc) · 1.92 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?
function mqesc($mixed)
{
if(is_array($buf))
{
reset($mixed);
while(list($key,$value) = each($mixed))
$mixed[$key] = mysql_real_escape_string($value);
}
else
$mixed = mysql_real_escape_string($mixed);
return $mixed;
}
class CSQL {
var $sqlSettings;
var $theQuery;
var $link;
function CSQL(&$settings) {
$this->sqlSettings =& $GLOBALS['sqlSettings'];
$opened = false;
}
function open() {
if(!function_exists("mysql_connect")) return false;
$this->link = mysql_connect($this->sqlSettings['dbHost'], $this->sqlSettings['dbUsername'], $this->sqlSettings['dbPassword']) or die("Error: Cannot connect to the database.");
mysql_select_db($this->sqlSettings['dbName']) or die("Error: Cannot connect to " . $this->sqlSettings['dbName'] . ".");
$opened = true;
return $opened;
}
function close() {
if(!function_exists("mysql_close")) return false;
mysql_close($this->link);
$opened = false;
return $opened;
}
}
class CQuery {
function query($query) {
$this->theQuery = $query;
if(!function_exists("mysql_query")) return false;
return mysql_query($query);
}
function fetcharray($result) {
if(!function_exists("mysql_fetch_array")) return false;
return mysql_fetch_array($result);
}
function fetchrow($result) {
if(!function_exists("mysql_fetch_row")) return false;
return mysql_fetch_row($result);
}
function fetchassoc($result) {
if(!function_exists("mysql_fetch_assoc")) return false;
return mysql_fetch_assoc($result);
}
function numrows($result) {
if(!function_exists("mysql_num_rows")) return false;
return mysql_num_rows($result);
}
function freeresult($result) {
if(!function_exists("mysql_free_result")) return false;
return mysql_free_result($result);
}
}
?>