DMZ already uses LAST_INSERT_ID, but I don't know that any database guarantees that multiple inserts are atomic. On a high-traffic website, the resulting IDs may not actually be serial.
(Also, even if one or more DB does do atomic inserts, many users use different databases. I, for example, use PostgreSQL almost exclusively, except when testing DMZ.)
Generating the insert should really be pretty simple :