I've seen similar questions asked, but none of the answers have worked for me. Mine is a simple form that includes some data into the database, where it is displayed in a table elsewhere on the website.
The form, however, just adds a blank row to the database, no matter what is entered. There are no errors or anything, just a blank row.
I have another form, which submits to another table, that works perfectly, so I am really confused.
Here is the form:
<form method="GET" action="addsuggestion.php">
<label>Game Title:</label>
<input type="text" name="gamename" id="gamename" />
<br />
<label>Game Platform:</label>
<input type="text" name="gameplatform" id="gameplatform" />
<br />
<label>Suggestor Nickname:</label>
<input type="text" name="suggestor" id="suggestor" />
<input type="submit" value="sumbit" />
</form>
And the addsuggestion.php
<?php
echo'<h1>Suggestion Process</h1>';
$connection = mysql_connect("removed", "removed", "removed") or die("Couldn't Connect!");
mysql_select_db("removed") or die("Couldn't find database!") ;
$gamename = $GET['gamename'];
$gameplatform = $GET['gameplatform'];
$suggestor = $GET['suggestor'];
$query = "INSERT INTO sug (gamename,gameplatform, suggestor) VALUES ('$gamename','$gameplatform','$suggestor')";
$result = mysql_query($query) or die ("Error in query");
echo'Submisson accepted, click <a href="recent.php">here</a> to check it out!';
?>
I get the submission accepted message and a row is added to the database, but it is always blank. The recent php shows the database as a table, with one new blank row.
There is an id that I am using as the primary key, but it is auto increment, so I haven't included it. That is the only field that contains something every time.