mysql_query($comandosql, $link) OR DIE(mysql_error());

Dovrebbe segnalare l'errore.