Yeah, we really do not need alternative solutions. mysql_insert_id is the only one that is concurrency proof and will work 100% of the time.
Developer always should code according to his needs and it definitely depends on aim of codes. My above code is just for educate other