Previous Thread
Next Thread
Print Thread
Hop To
#226636 05/19/2009 4:03 AM
Joined: Jun 2006
Posts: 3,837
I
Ian
Offline
Carpal Tunnel
Carpal Tunnel
I Offline
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.

Code
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. smile

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.

Code
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! smile

Joined: Mar 2008
Posts: 326
D
Enthusiast
Enthusiast
D Offline
Joined: Mar 2008
Posts: 326
SQL Query
select distinct POST_POSTER_IP
from ubbt_POSTS
where USER_ID = '#'
order by POST_POSTER_IP asc

SQL Query
select distinct USER_ID
from ubbt_POSTS
where POST_POSTER_IP = '###.###.###.###'
order by USER_ID asc

Joined: Mar 2009
Posts: 64
P
journeyman
journeyman
P Offline
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

SQL Query
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


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
spam issues
by ECNet - 03/19/2024 11:45 PM
Who's Online Now
1 members (Geoff), 341 guests, and 193 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)