certo se scrivi l'errore che ti restituisce sarebbe più interessante =P

codice:
mysql_query ($dati) or die (mysql_error());