that looks correct, the agent_id form elements all have valid values.
Try changing:
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
to:
echo("<pre>");
var_dump($_POST);
echo("</pre>");
die("sql: ".$WA_Sql);
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
and post back the results, this will help me troubleshoot further.