changed mysql to mysqli, output compression