Convert to using mysqli