Gunakan LAST_INSERT_ID() fungsi: update table whatever set product_id = id where id = last_insert_id()