Commit c9c2c245 by alsunj

Upload New File

parent 1f8a27f5
Showing with 26 additions and 0 deletions
<?php
$con = mysqli_connect('localhost', 'root','root', 'unity', '3306');
if(mysqli_connect_errno())
{
echo "1";
exit();
}
//unityst saadud tulemused
$username = $_POST['username'];
$bank = $_POST['bank'];
$loses = $_POST['loses'];
$wins = $_POST['wins'];
//päring mis sisestab tabelisse users uue pangaseisu kindlale sisselogitud kasutajale
$updateuserquery = "UPDATE users SET bank = '$bank' WHERE username = '$username';";
mysqli_query($con, $updateuserquery) or die("4: ei saa kasutajat lisada");
//päring mis sisestab tabelisse player uued streakid (kaotused, võidud), samamoodi sisselogitud kasutajale.
$insertuserquery = "UPDATE player SET loses = '$loses' + loses, wins = '$wins' + wins WHERE username = '$username';";
mysqli_query($con, $insertuserquery) or die("5: streakid");
echo("0");
?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment