Skip to content

Commit

Permalink
Statistics Fix
Browse files Browse the repository at this point in the history
(cherry picked from commit 1be703a)
  • Loading branch information
Tsumiki-Chan committed Sep 25, 2019
1 parent 96f51df commit c79c6a5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions stat.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
$secret = $sqllink->real_escape_string($_POST['key']);
$name = $sqllink->real_escape_string($_POST['uname']);
$game = $sqllink->real_escape_string($_POST['game']);
$notrack = $sqllink->query("SELECT id FROM notrack WHERE id='".$user."';");
$notrack = $sqllink->query("SELECT id FROM notrack WHERE id='{$user}' and game LIKE '{$game}';");
$notrack = $notrack->num_rows;
if(strlen($user) <= 0 || strlen($secret) <= 0)
{
Expand All @@ -46,11 +46,11 @@
$date = $sqllink->real_escape_string(time());
if($return['success'] == true){
// Haben wir die UID oder Secret bereits?
$matches = $sqllink->query("SELECT user,secret FROM users WHERE user='".$user."' OR secret='".$secret."';");
$matches = $sqllink->query("SELECT user,secret FROM users WHERE (user='{$user}' and game LIKE '{$game}') OR secret='{$secret}';");
// Wir kennen weder UID, noch Secret. Wir speichern den neuen Nutzer
if(!$matches->num_rows)
{
$query = "INSERT INTO users (user,secret,game,name,time,data) VALUES ('".$user."','".$secret."','".$game."','".$name."','".$date."','".$data."');";
$query = "INSERT INTO users (user,secret,game,name,time,data) VALUES ('{$user}','{$secret}','{$game}','{$name}','{$date}','{$data}');";
$result = $sqllink->query($query);
$id = $sqllink->insert_id;
if(!$result){
Expand All @@ -66,7 +66,7 @@
if($row['user'] == $user && $row['secret'] == $secret)
{
$valid = true;
$query = "UPDATE users SET game='".$game."', name='".$name."', time='".$date."', data='".$data."' WHERE user='".$user."' AND secret='".$secret."';";
$query = "UPDATE users SET game='{$game}', name='{$name}', time='{$date}', data='{$data}' WHERE (user='{$user}' and game LIKE '{$game}') OR secret='{$secret}';";
$result = $sqllink->query($query);
break;
}
Expand Down

0 comments on commit c79c6a5

Please sign in to comment.