grazie ho trovato la soluzione
mysql_insert_id() anche questo va bene