Código PHP:
if ($_POST["submit"]=="esborra"){
$resultat=mysql_query("DELETE from treballadors WHERE DNI=$DNI",$conexio);
$files=mysql_affected_rows($conexio);
if (mysql_errno($conexio)==0){
echo "<center><h2> FILES ELIMINADES: $files</h2></center>";
echo "<br>";
}
else
$numeroerror=mysql_errno($conexio);
$descripcioerror=mysql_error ($conexio);
{
echo "num_derror $numeroerror";
echo '<br>';
echo "descripcio $descripcioerror";
}
}
acostumbrate a identar el código, y así no tendrás fallos en bulces o condicionales
PD: indentar= poner tabs :D