ok grazie!
ma LAST_INSERT_ID() posso anche metterlo in una INSERT, tipo
INSERT INTO nometabella(a, b) VALUES(1, LAST_INSERT_ID(id));