For some reason my UPDATE script isn't working. Can anyone spot a problem with either of these -
<html>
<title>
LeagueSQL - Admin
</title>
<body>
<h1>Create League</h1>
<form action="createtable.php" method="post">
League Name: <input type="text" name="leagueName" />
<input type="submit" />
</form>
<br />
<h1>Add Player</h1>
<form action="addplayer.php" method="post">
Add Player: <input type="text" name="playerName" />
To League: <input type="text" name="leagueName" />
<input type="submit" />
</form>
<br />
<h1>Remove Player</h1>
<form action="removeplayer.php" method="post">
Remove Player: <input type="text" name="playerName" />
From League: <input type="text" name="leagueName" />
<input type="submit" />
</form>
<br />
<h1>Add Score</h1>
<form action="addsimplescore.php" method="post">
Winner:<input type="text" name="winner" />
Loser:<input type="text" name="loser" />
League: <input type="text" name="leagueName" />
<input type="submit" />
</form>
<br />
SITE UNDER DEVELOPMENT!!!
</body>
</html>
<?php
// SimpleScore beta
error_reporting(E_ALL);
//SCORE ADDITION CODE.
//Connect & Select.
$con = mysql_connect("localhost","u08105199","edited");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("u08105199", $con);
//Declare variables.
$player1 = (mysql_real_escape_string($_POST["winner"]);
$player2 = mysql_real_escape_string($_POST["loser"]);
$leagueName = mysql_real_escape_string($_POST["leagueName"]);
//Create queries.
mysql_query("UPDATE $leagueName SET Points = '3'
WHERE PlayerName = {$player1}");
//Close connection.
mysql_close($con);
?>
<html>
<br />
<br />
<a href="http://student.dc.lincoln.ac.uk/~u08105199/admin.php">Click here</a> to go back to the homepage!
</html>
Any help would be appreciated.