altered for mysqli