aggiungi questo :

$aggiorna=mysql_query("UPDATE atti SET newdata = \"$data\" where idatto = $idatto") or die( mysql_error() ) ;