Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $sqlhost = "localhost";
- $sqluser = "xxx";
- $sqlpass = "xxx";
- $sqlbase = "xxx";
- mysql_connect($sqlhost, $sqluser, $sqlpass) OR die(mysql_error());
- mysql_select_db($sqlbase) OR die(mysql_error());
- ?>
- <?php
- $id = $_POST['id'];
- $score = $_POST['score'];
- $type = $_POST['type'];
- $tournament_id = $_POST['tournament'];
- $player_id = $_POST['player'];
- echo $player_id;
- switch($id){
- case "-1":
- $score--;
- $s_q = "UPDATE `tournament_player` SET $type = ('$score') WHERE tournament_id = '$tournament_id' && player_id = '$player_id'";
- mysql_query($s_q) or die(mysql_error());
- break;
- case "+1":
- $score++;
- $s_q = "UPDATE `tournament_player` SET $type = ('$score') WHERE tournament_id = '$tournament_id' && player_id = '$player_id'";
- mysql_query($s_q) or die(mysql_error());
- break;
- case "0":
- $score = 0;
- $s_q = "UPDATE `tournament_player` SET $type = ('$score') WHERE tournament_id = '$tournament_id' && player_id = '$player_id'";
- mysql_query($s_q) or die(mysql_error());
- break;
- }
- echo $score;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement