Is it possible to have a race condition with mysql_insert_id()? You add a record, another script adds a record, then you call mysql_insert_id() and get the other scripts record ID?
not if you're paying attention to the link_identifier and supplying that to the function.