to troubleshoot, change line 17:
$LoginRS=mysql_query($LoginRS__query, $con2com) or die(mysql_error());
to:
echo("dupe check = ".$LoginRS__query."br/>");
$LoginRS=mysql_query($LoginRS__query, $con2com) or die(mysql_error());
and 51:
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
to:
die("Insert = ".$WA_Sql);
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
report back the sql statements this writs to the screen