XF 1.5 Query to remove ip address from all users?

Brent W

Well-known member
While setting up RailGun we briefly had it live where it wasn't forwarding the users ip address but instead our servers ip address. This means that many members show up as sharing our servers ip address. How can I delete that IP address from all users accounts?
 

Mike

XenForo developer
Staff member
Code:
DELETE FROM xf_ip WHERE ip = UNHEX(LPAD(HEX(INET_ATON('1.2.3.4')), 8, '0'));
Change 1.2.3.4 as needed.

I haven't tested this yet, so I'd recommend using the SELECT version to confirm it's grabbing what you expect and, as usual, I'd recommend backing up before running this.
 

Brent W

Well-known member
Code:
DELETE FROM xf_ip WHERE ip = UNHEX(LPAD(HEX(INET_ATON('1.2.3.4')), 8, '0'));
Change 1.2.3.4 as needed.

I haven't tested this yet, so I'd recommend using the SELECT version to confirm it's grabbing what you expect and, as usual, I'd recommend backing up before running this.
Worked perfectly.
 
Top