diff options
Diffstat (limited to 'includes')
-rw-r--r-- | includes/datas.php | 9 | ||||
-rw-r--r-- | includes/sqli.php | 12 |
2 files changed, 20 insertions, 1 deletions
diff --git a/includes/datas.php b/includes/datas.php index 6cc8f07..e99e347 100644 --- a/includes/datas.php +++ b/includes/datas.php @@ -1135,7 +1135,8 @@ function loadChallengeListing($userIdUnsanitized) { $userID = mysql_escape_string($userIdUnsanitized); $sql = " - SELECT maps.ID AS mapID, maps.challengeTier, maps.name, challengeSolutions.dateSolved + SELECT maps.ID AS mapID, maps.challengeTier, maps.name AS name, + challengeSolutions.dateSolved, challengeSolutions.challengeID AS challengeID FROM maps INNER JOIN challenges ON maps.ID = challenges.mapID LEFT JOIN challengeSolutions ON challenges.ID = challengeSolutions.challengeID @@ -1144,6 +1145,12 @@ function loadChallengeListing($userIdUnsanitized) AND maps.challengeTier <= (SELECT challengeTier FROM users WHERE users.ID = '$userID') ORDER BY maps.challengeTier, maps.challengeSuborder, challenges.ordering "; + $sql = " SELECT maps.ID AS mapID, maps.challengeTier, maps.name AS name, + challengeSolutions.dateSolved, challengeSolutions.challengeID AS challengeID + FROM challenges + LEFT JOIN maps ON challenges.mapID = maps.ID + LEFT JOIN challengeSolutions ON challenges.ID = challengeSolutions.challengeID AND challengeSolutions.userID = '$userID' + ORDER BY maps.challengeTier, maps.challengeSuborder, challenges.ordering"; $result = mysql_query($sql); echo mysql_error(); diff --git a/includes/sqli.php b/includes/sqli.php new file mode 100644 index 0000000..0974380 --- /dev/null +++ b/includes/sqli.php @@ -0,0 +1,12 @@ +<?php
+
+//global $mysqlid;
+$db_host = "db2894.perfora.net";
+$db_user = "dbo362854667";
+$db_name = "db362854667";
+$db_pass = "mazes4me";
+// $mysqlid = @mysql_connect($db_host,$db_user, $db_pass) or die("Cannot connect to database.");
+// @mysql_select_db($db_name, $mysqlid) or die("Invalid database.");
+
+$mysqli = mysqli_connect($db_host, $db_user, $db_pass, $db_name) or die("Failed to connect to database");
+?>
\ No newline at end of file |