Do you have DataAssist? Use DataAssist to do the insert and the newly inserted ID is automatically stored in the session for you.
In php you can access the newly inserted id on the page after it is inserted as: mysql_insert_id()
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.