Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9071655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T17:57:57+00:00 2026-06-16T17:57:57+00:00

I’m attempting to create a PHP file that will open up my PHPBB3 database

  • 0

I’m attempting to create a PHP file that will open up my PHPBB3 database and retrieve a list of all the Minecraft usernames on the forum which will be used as a whitelist on the associated game server. The username (urbb_profile_fields_data.pf_mcusername) needs to be filtered by the following: The username is not null, is not blank, is not banned (ID does not match an ID within urbb_banlist.ban_userid) and has been activated (urbb_users.user_inactive_reason is 0).

My knowledge of SQL is admittedly very poor, but I have got this completely working and implemented:

SELECT urbb_profile_fields_data.pf_mcusername, urbb_profile_fields_data.user_id, urbb_banlist.ban_userid
FROM urbb_profile_fields_data, urbb_banlist
WHERE ((pf_mcusername IS NOT NULL) AND (pf_mcusername <> ''))
AND ban_userid != urbb_profile_fields_data.user_id

However, when I attempt to use:
urbb_users.user_inactive_reason within SELECT
and urbb.users within FROM, SQL will retrieve over 7000 results that appear to loop and over. This happens as soon as I enter urbb_users in FROM.

Undoubtedly there’s something that I’m missing here because I’m not really familiar with JOIN (I’ve read a few tutorials on it) so I’m hoping someone can help out here!

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T17:57:58+00:00Added an answer on June 16, 2026 at 5:57 pm

    There is a substantial problem with your implementation of the query. It shouldn’t actually work even without any other tables involved.

    What “FROM A, B” means in SQL is “Make another table which has all the fields of both A and B and its lines are all possible combinations from both A anb B” and select from there.
    So, say you have 4 lines in each table the resulting table will have 16 lines. To filter unneccessary lines, you use a condition, “WHERE A.user_id = B.user_id”. That way the resulting table will have only lines both parts of which correspond to actually the same user.

    Your query though has “WHERE A.user_id != B.user_id” and should return a looped set of all lines in which both parts do not match. If you have only 1 player in banned list it will work, but if there are atleast 2, not only it will loop, it will also let banned players into the resulting list. Also, if you have NO banned users, the query result will be empty.

    The proper query would look like this:

    SELECT A.username, B.user_id FROM A LEFT JOIN B ON A.user_id = B.banned_id
    WHERE B.banned_id IS NULL
    

    Basically, you look for rows in table A that have no match in table B.
    To add other tables into the query you need to hook them up like that:

    SELECT A.username, B.user_id FROM A LEFT JOIN B ON A.user_id = B.banned_id
    LEFT JOIN C ON A.user_id = C.user_id WHERE B.banned_id IS NULL
    

    Hope it helps…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create an if statement in PHP that prevents a single post
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I have a reasonable size flat file database of text documents mostly saved in
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.