Verifica que no tengas errores en tu consulta:
Código PHP:
if (isset($_POST["verificar"])){
$resultat=mysql_query("SELECT Nom,Cognoms from treballadors WHERE DNI='$DNI'",$conexio)or die("Error en query:" . mysql_error() );
$numero=mysql_num_rows($resultat)
Saludos.