In PHP, there is a method called mysql_insert_id for this feature. But, it is valid for race condition only if the argument is link_identifier of last operation. My operation with database is on $wpdb. How to extract the link_identifier from $wpdb to make sure mysql_insert_id work? Is there any other way to get the last-inserted-row id from $wpdb? any table which is we are using.
Last insert id in WordPress
$lastid = $wpdb->insert_id;