What is the value you are storeing in the cart ID column?
at line 211, change:
$WA_editCmd = mysql_query($WA_sql, $WA_connection) or die(mysql_error());
to:
$WA_editCmd = mysql_query($WA_sql, $WA_connection) or die(mysql_error()."<br />".$WA_sql);
this will show the sql that is being generated along with the error for trouble shooting.