migrate the MySQL class to mysqli