Switch mysql to mysqli