Switch from mysql to mysqli library