<?php
$score = $_GET['score'];
$winnersname = $_GET['winnersname'];
$losersname = $_GET['losersname'];
$wins = $row["wins"];
$draws = $row["draws"];
$losses = $row["losses"];
$points = $row["points"];
$win = 1;
$winpoints = 3;
?>
<?php
if ($_GET['step'] == '1' & $_GET['score'] == '4-2' OR $_GET['score'] == '5-1' OR $_GET['score'] == '6-0')
{
$db=mysql_connect("localhost", mydbuser, mydbpass);
@mysql_select_db(mydb_name) or die( "Unable to select database");
mysql_query("UPDATE playerstable SET wins = $wins + $win, points = $points + $winpoints WHERE `playername` = '$winnersname'") or print mysql_error();
mysql_query("UPDATE playerstable SET losses = $losses + $winpoints WHERE playername = $losersname") or print mysql_error(); ?>
<br>
<br>
<?php echo "$winnersname's win against $losersname ($score) has been successfully added.";}
elseif ($_GET['score'] == '3-3') {
$db=mysql_connect("localhost", db_user, db_pass);
@mysql_select_db(db_name) or die( "Unable to select database");
mysql_query("UPDATE playerstable SET draws = $draws + $win, points = $points + $win WHERE `playername` = '$winnersname'") or print mysql_error();
mysql_query("UPDATE playerstable SET draws = $draws + $winpoints, points = $points + $win WHERE `playername` = '$losersname'") or print mysql_error();
echo "The 3-3 result between $winnersname and $losersname has been successfully added.";
?>
<br>
<?php
echo "<a href='?winnersname=$winnersname&losersname=$losersname&step=2'>Next Step</a>";
} elseif ($_GET['step'] == '2')
{
$db=mysql_connect("localhost", db_user, db_pass);
@mysql_select_db(db_name) or die( "Unable to select database");
mysql_query("DELETE FROM `gamestable` WHERE `winnersname` = '$winnersname'") or print mysql_error();
mysql_query("DELETE FROM `gamestable` WHERE `losersname` = '$losersname'") or print mysql_error();
echo "Username <b>$addname</b> Has been removed from game validation table."; ?>
<br>
<?php
echo "<a href='index.php'>Home Page</a>";
}
?>
I'm still a beginner with this kinda stuff, can anyone see any probs with my coding?
it displays the error...
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '+ 1, points = + 3 WHERE playername = 'nicknax'' at line 1You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '+ 3 WHERE playername = Revenge' at line 1