Forum Moderators: mack
I'm creating a website, that allows me and a friend to review games we've played. Everything was going well untill I got to this point:
When I want to add a review, I goto a page that contains a LIST of games currently residing in the database. I then want to be able to select that game, from the list then carry on and add a review to it.
So far it looks like this:
<form action='addrev.php' method='post'>
<select name="games" size="1">
<?php
$sql = "SELECT * FROM Games";
$result = mysql_query($sql);
while ($game = mysql_fetch_row($result)) {
echo("
<option value='$game[0]'>$game[1]</option>
");
}
?>
</select>
<p><input name="Submit" type="submit" value="Review">
</form>
This generates the list perfectly. However, once I select my game and click Submit... I cannot retrieve the information I want.
I want the value to be passed to the next page, so that when I add the review the value(which is an integar) is added to the reviews database.
Example:
$SQL = "INSERT INTO Reviews (reviewID, userID, gameID) VALUES ( 'NinjaGaiden', '23' , '$value' )";
But, $value is never assigned...
If you can translate my jibberish, then please, I emplore you - Help :)
Thanks alot,
Sainty.