Använd LAST_INSERT_ID() funktion: update table whatever set product_id = id where id = last_insert_id()