forked from nickwhynot/whynotv5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
getuser.php
35 lines (30 loc) · 997 Bytes
/
getuser.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
<?php
function gettags($username) {
$con = mysqli_connect("aarv6gcxs2fign.cz4enrv4fad3.eu-west-1.rds.amazonaws.com","root","ladsonline1","whynotv4");
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$usertagssql = "SELECT Tag, Weight FROM UserTags WHERE User='$username'";
$data = mysqli_query($con, $usertagssql);
$datarray = array();
while($row = mysqli_fetch_assoc($data)) {
$datarray[] = $row;
}
return $datarray;
}
function getevents($username) {
$con = mysqli_connect("aarv6gcxs2fign.cz4enrv4fad3.eu-west-1.rds.amazonaws.com","root","ladsonline1","whynotv4");
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$usertagssql = "SELECT Event FROM UserHistory WHERE (User='$username' AND `TIMESTAMP` > CURDATE())";
$data = mysqli_query($con, $usertagssql);
$datarray = array();
while($row = mysqli_fetch_array($data)) {
$datarray[] = $row['Event'];
}
return $datarray;
}
?>