<html>
<head>
<title>Participants</title>
</head>
<table align="center">
<tr>
<td>
<a href="http://www.officalhalo.com">Home</a>
<a href="/tournament/FFA.htm">FFA</a> |
<a href="/tournament/signup.htm">Sign Up</a> |
<a href="/tournament/results.htm">Results</a>
</td>
</tr>
</table>
<body>
<h3 align="center">Participants</h3>
<?php
$gamertag=$_POST['gamertag'];
$eaddress=$POST['eaddress'];
if (!$gamertag || !$eaddress)
{
echo 'You have not entered all of the required information.<br />'
.'Please go back and try again.';
exit;
}
if (!get_magic_quotes_gpc())
{
$gamertag = addslashes($gamertag);
$eaddress = addslashes($eaddress);
}
@ $db = new mysqli('localhost', 'username', 'password', 'chilllax_participants');
if (mysqli_connect_error())
{
echo 'Error: Could not connect to database. Please try again later.';
exit;
}
$query = "insert into participants values
('$gamertag', '$eaddress'}";
$result = $db->query($query);
if ($result)
echo $db->affected_rows.' participant added.
$db->close();
?>
</body>
</html>
Theres the code in my page. I have the database set up and also the correct number of tables. My problem is whenever I try and run this script this error comes up parse error, unexpected $. Why is this. Also I am going by a php book thats infront of me and I dont really understand the bit of code that actually inserts the data into the database. This
$query = "insert into participants values
('$gamertag', '$eaddress'}";
Thanks for any help. I hope that made sense. :confused: