Forum Moderators: coopster
</select>
if($type == "game"){$result = mysql_query....
notice the quotes
I'll note a few of the issues I spotted so you can try and break down what you're doing into smaller, more easily debugged parts.
list($game, $type)= explode('¦', $_POST[game]);
should be:
list($game, $type)= explode('¦', $_POST["game"]);
if($type == game)
should be:
if($type == $game)
$result = mysql_query( "SELECT TeamName,Owner,Wins,Loses FROM $dbname WHERE game_name = '$_POST[game]'")or die("SELECT Error: ".mysql_error());
should be:
$result = mysql_query( "SELECT TeamName,Owner,Wins,Loses FROM $dbname WHERE game_name = '$game'")or die("SELECT Error: ".mysql_error());
IMPORTANT:
You are using potentially 'tainted' data in your sql statement (ie, you're 'assuming' that the information coming in through $_POST is clean and hasn't been altered in any way). This is a major security risk in your application and you'll need to review this when you have the other parts working.
mysql_query ( "SELECT user_id FROM $dbnametwo WHERE Teamname = '$_POST[game]'")or die("SELECT Error: ".mysql_error());
should be:
mysql_query ( "SELECT user_id FROM $dbnametwo WHERE Teamname = '$team'")or die("SELECT Error: ".mysql_error());
(also, again you're assuming 'cleanliness' of potentially unsafe data in this call).