hmmm, not sure why it is adding the %20 for the space, I cannot get it to reproduce the problem, perhaps try changing:
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
to:
$MM_editCmd = mysql_query(str_replace("%20", " ", $WA_Sql), $WA_connection) or die(mysql_error());