Upgrade mysql class to mysqli