Okay I think I understand what you all are saying but I don't know if I did it right. I can get the filter button to work but not the submit.
HTML
<!DOCTYPE HTML>
<html>
<head>
<title>Icewolf is the Man!!</title>
</head>
<body>
<Form action="Dropdown_new.php" method="POST" target="showhere">
<select name="Member_ID">
<option value="">Select one…</option>
<option value="Icewolf">Icewolf</option>
<option value="Travisr826">Travisr826</option>
<option value="josehasthestick">josehasthestick</option>
<option value="Hhn87">Hhn87</option>
<option value="Twisted31007">Twisted31007</option>
<option value="Midget_chunkin">Midget_chunkin</option>
<option value="cashstro718">cashstro718</option>
<option value="mpnak313">mpnak313</option>
<option value="Wisconsin24">Wisconsin24</option>
<option value="usmc57-2">usmc57-2</option>
<option value="Derbin11">Derbin11</option>
<input type="submit" name="filter" value="filter">
</select>
Bank:
<input type="text" name="bank" />
Reward 1:
<input type="text" name="reward1" />
Reward 2:
<input type="text" name="reward2" />
Reward 3:
<input type="text" name="reward3" />
<input type="submit" name="submit" value="Update" />
</form>
<iframe width="800" height="100" name="showhere" marginheight="0" marginwidth="0" frameborder="0" scrolling="no"> </iframe>
</body>
</html>
PHP
<?php
$username = "Userid";
$password = "Password";
$hostname = "localhost";
//connection to the database
$dbhandle = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
echo "<font face=tahoma color=#ff000><b>Connected to MySQL</b></font><br><br>";
//select a database to work with
$selected = mysql_select_db("pdogclan_points",$dbhandle)
or die("Did this change");
// Formulate Query
if (isset($_POST['filter'])){
$memid = mysql_real_escape_string($_POST["Member_ID"]);
$query = sprintf("SELECT Member_ID, Bank, Reward_1, Reward_2, Reward_3 FROM Points_Rewards WHERE Member_ID = '$memid'") or die("Could Not Formulate the Query");
}
//execute the SQL query and return records
$result = mysql_query($query);
// Check result
// This shows the actual query sent to MySQL, and the error. Useful for debugging.
//if (!$result) {
// $message = 'Invalid query: ' . mysql_error() . "\n";
// $message .= 'Whole query: ' . $query;
// die($message);
//}
//fetch tha data from the database
while ($row = mysql_fetch_array($result))
echo "<table width=750 cellspacing=2 cellpadding=2 border=2>
<tr>
<td bgcolor=#000000 width=150><font face=tahoma color=white>ID: {$row['Member_ID']}</font></td>".
"<td width=150><font face=tahoma>Bank: {$row['Bank']}</td>".
"<td width=150><font face=tahoma>Reward 1: {$row['Reward_1']}</td>".
"<td width=150><font face=tahoma>Reward 2: {$row['Reward_2']}</td> ".
"<td width=150><font face=tahoma>Reward 3: {$row['Reward_3']}</td>
</tr>
</table><br></font>";//display the results
// Formulate Update Query
Else if (isset($_POST["submit"])){
$memid = mysql_real_escape_string($_POST["Member_ID"]);
$bank = $_POST['bank'];
$reward1 = $_POST['reward1'];
$reward2 = $_POST['reward2'];
$reward3 = $_POST['reward3'];
}
$query = "UPDATE Points_Rewards Set Bank = '$bank', Reward_1 = '$reward1', Reward_2 = '$reward2', Reward_3 = '$reward3' WHERE Member_ID = '$memid'";
$result = mysql_query($query) or die(mysql_error());
//echo $query;
//if(mysql_query($query)){
//echo "updated";}
//echo "fail";}
//close the connection
mysql_close($dbhandle);
?>