You were, as usual, right. It was the quotes. However, that raises a question. The code said:
$query = "UPDATE master_game_sched SET ref1 = '$ref1', ref2 = '$ref2' , ref3 = '$ref3' , ref4 = '$ref4'
WHERE gameID='$gameID' LIMIT 1";
mysql_query($query)or die ("Error in query: $query");
with a single quote around the WHERE clause '$gameID'. I actually lifted that from another routine that I knew worked. I fixed the current code by removing the single quotes around $gameID. That fix made it work...but I don't understand why, since the original code worked with the single quotes in place. Both the original code that I borrowed and this code are virtually identical.
I have another challenge that I could use some pointers on. I am using a do loop to create a drop down. I am dealing with two tables. The ref_table which has the ref's ID and name and the master_game_schedule which stores only the referee's ID number.
The problem is that I can get the updated value ($refInfo['refID'] ) or the current value of the referee ($refInfo['refID']) for a specific game from the master_game_schedule, but I can't figure out how to tie the refID number in with the ref_table to get the referees name. The $contact['ref1'] comes from the master_game_schedule table.
Here's the code: The option values come from the ref_table and the option selected comes from the master_game_schedule.
//--| REFEREE 1
$sql_ref ="SELECT *
FROM ref_table
ORDER BY refLast ";
$res_ref = mysql_query($sql_ref, $link )or die(mysql_error($mysql));
echo "<td>";
print "<span class='table_small_type' width ='10%'>
<select name=ref1_ud['".$contact['gameID']."']>";
do{
print "<option value='" . $refInfo['refID'] . "'>" . $refInfo['refLast'] . ", " .$refInfo['refFirst']. " #" .$refInfo['region'] . "</option> \n";
}
while($refInfo = mysql_fetch_array($res_ref, MYSQL_ASSOC));
print "<option selected= '" . $contact['ref1'] . "'selected>" . $contact['ref1']. "</option>";
Thanks much!