Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function updateWins($servername, $username, $password, $dbname, $InsertedWins, $AccId) {
- $conn = new mysqli($servername, $username, $password, $dbname);
- $date = date("d/m H:i");
- $selectcurrentwins = "SELECT wins FROM SteamIDs WHERE number = '". $AccId ."'";
- $pass = mysqli_query($conn, $selectcurrentwins);
- $result = mysqli_fetch_array($pass, MYSQLI_ASSOC);
- $current_wins = $result['wins'];
- if ($current_wins != $InsertedWins) {
- $insert = "UPDATE SteamIDs SET wins = ". $InsertedWins ." WHERE number = ". $AccId . "";
- mysqli_query($conn, $insert);
- if (($current_wins == 1 and $InsertedWins == 2) or ($current_wins == 3 and $InsertedWins == 4) or ($current_wins == 5 and $InsertedWins == 6) or ($current_wins == 7 and $InsertedWins == 8)) {
- $insert = "UPDATE SteamIDs SET date = '". $date ."' WHERE number = ". $AccId . "";
- mysqli_query($conn, $insert);
- }
- }
- elseif ($current_wins == $InsertedWins) {
- return;
- }
- mysqli_close($conn);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement