Replace mysql with mysqli