I use DBI's last_insert_id() method. If you're using a new enough DBD, it's there.
In reply to Re: MySQL: INSERT and return? by chromatic in thread MySQL: INSERT and return? by Spidy