moving mysqli generation to not break common_func