To trouble shoot, find the following line of code:
$WA_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
it occur more than once, find all occurrences, and change them to:
$WA_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error()."<br /".$WA_Sql);
this will cause the SQL that is generating the error message to be written to the screen to help pinpoint the cause of the problem.