Finalizing mysql lookups