What I want to do is collect a gamers username and their email address send that into my database and then display all of the gamers who have signed up on another page using the database. I made the html form that was fairly simple. My problem is getting that information into the database. When I run the scrip that is supposed to put the information into the databse there is never an error but the information never gets put into the databse. Heres the code of the script (thanks for any help):
<html>
<head>
<title>Your Entry</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">Your Entry</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;
}
@ $db = new mysqli('localhost', 'chilllax_chillla', 'red123', 'chilllax_tournament');
if (mysqli_connect_errno())
{
echo 'Error: Could not connect to database. Please try again later.';
exit;
}
$query = "insert into ffa values
('".$gamertag."', '".$eaddress."')";
$result = $db->query($query);
if ($result)
echo $db->affected_rows.' Entry submitted into database.';
$db->close();
?>
</body>
</html>