-
Notifications
You must be signed in to change notification settings - Fork 1
/
database.php
74 lines (54 loc) · 1.77 KB
/
database.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
##################### System #########################
define("SYSNAME","Wolf Territories Grid");
define("SYSURL","http://grid.wolfterritories.org:8002");
define("SYSMAIL","lonewolf@wolfterritories.org");
// Key of the account that all fees go to:
$economy_sink_account="put uuid of charge account to";
// Key of the account that all purchased currency is debited from:
$economy_source_account="put uuid of main podex account here ";
// Minimum amount of real currency (in CENTS!) to allow purchasing:
$minimum_real=0;
// Error message if the amount is not reached:
$low_amount_error="You tried to buy less than the minimum amount of currency. You cannot buy currency for less than US$ %.2f.";
$databasehost="database host";
$databaseusername="database username";
$databasepassword="database password";
$con = mysqli_connect($databasehost, $databaseusername, $databasepassword);
mysqli_select_db($con,"robust");
mysqli_set_charset($con, 'utf8mb4');
function escape($str) {
global $con;
return mysqli_real_escape_string($con, $str);
}
function pcGetRecordFrom($db, $query) {
$r = mysqli_query($db, $query);
if (!$r) {
echo "Error in " . $query;
}
$data = "";
$found = False;
$resultx = "";
$numrows = mysqli_num_rows($r);
if ($numrows > 0) {
while ($row = mysqli_fetch_assoc($r)) {
return $row;
}
}
return $resultx;
}
function pcGetDataFrom($db, $query, $field) {
$r = mysqli_query($db, $query);
$data = "";
$found = False;
$resultx = "";
$numrows = mysqli_num_rows($r);
if ($numrows > 0) {
while ($row = mysqli_fetch_assoc($r)) {
$found = True;
$resultx = $row[$field] . "";
break;
}
}
return $resultx;
}