• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

SQl query for location

#1
I am wanting to query the database where location = "specific city" and return a list of e-mails. Can anyone help with how to write the query? I'm a clueless SQL user.
 

Brogan

XenForo moderator
Staff member
#2
Try this:
Code:
SELECT u.email
FROM xf_user as u
LEFT JOIN xf_user_profile AS p ON
(p.user_id = u.user_id)
WHERE p.location = 'London'
Change 'London' to suit.