|
|
Joined: Jun 2006
Posts: 3,837
Carpal Tunnel
|
Carpal Tunnel
Joined: Jun 2006
Posts: 3,837 |
Hi,
I am urgently trying to locate a SQL command to show all IP's used by a particular user.
Would also be useful to have a SQL command to show everyone who has posted under say the IP of 1.2.3.4
Thanks in advance.
|
|
|
|
Joined: Nov 2006
Posts: 40
newbie
|
newbie
Joined: Nov 2006
Posts: 40 |
Tested on 7.5.3, this'll give you the IPs for a given user. Replace # with your given UBBT table prefix, and ### with the ID number of the member you're interested in. SELECT `#_POSTS`.`POST_ID`, `#_POSTS`.`POST_SUBJECT`, `#_POSTS`.`POST_POSTER_IP`, `#_USERS`.`USER_DISPLAY_NAME`
FROM `#_POSTS`,
`#_USERS`
WHERE `#_USERS`.`USER_ID` = `#_POSTS`.`USER_ID`
AND `#_USERS`.`USER_ID` = ### It's not very clean, and there'll be repeats, but it's a start.
|
|
|
|
Joined: Nov 2006
Posts: 40
newbie
|
newbie
Joined: Nov 2006
Posts: 40 |
This'll give you the posts from a given IP - same as above, replace # with your UBBT table prefix, and ### with the IP number you're interested in. SELECT `#_POSTS`.`POST_ID`, `#_POSTS`.`POST_SUBJECT`, `#_POSTS`.`POST_POSTER_IP`, `#_USERS`.`USER_DISPLAY_NAME`
FROM `#_POSTS`,
`#_USERS`
WHERE `#_POSTS`.`POST_POSTER_IP` = "###" These aren't perfect - they need work!
|
|
|
|
Joined: Mar 2008
Posts: 326
Enthusiast
|
Enthusiast
Joined: Mar 2008
Posts: 326 |
select distinct POST_POSTER_IP
from ubbt_POSTS
where USER_ID = '#'
order by POST_POSTER_IP asc
select distinct USER_ID
from ubbt_POSTS
where POST_POSTER_IP = '###.###.###.###'
order by USER_ID asc
|
|
|
|
Joined: Mar 2009
Posts: 64
journeyman
|
journeyman
Joined: Mar 2009
Posts: 64 |
I was given this to find other people using the same IP Does not seem to do the trick all the time but it catches a few SELECT t2.USER_DISPLAY_NAME
FROM ubbt_USERS AS t2, ubbt_POSTS
AS t1
WHERE t1.USER_ID = t2.USER_ID
AND t1.POST_POSTER_IP
LIKE '55.23.219.444' edited to say I can not figure out how to post the command and have it show
|
|
|
0 members (),
1,144
guests, and
193
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
|
|
|