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 8570447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:33:36+00:00 2026-06-11T18:33:36+00:00

I have a phpbb forum using mysql databases. The users are identified by user_id.

  • 0

I have a phpbb forum using mysql databases. The users are identified by “user_id.” However, they have multiple groups. Users will either be in the “human” (9) or “zombie” (8) group. However, they will always be in the “registered” (2) group. This creates a table that looks like this:

mysql table

Three databases are used in total to form a new table.

SELECT phpbb_users.user_id 'ID',
IF( phpbb_user_group.group_id =9,  'Human', IF( phpbb_user_group.group_id =8,  'Zombie', '')) AS Team,

IF( phpbb_profile_fields_data.pf_oz =1,  'Yes',  ' ' ) AS OZ,
phpbb_users.username 'Player', phpbb_users.user_email 'E-mail',
IF( phpbb_profile_fields_data.pf_share_phonenum =1, phpbb_profile_fields_data.pf_phone_number,  ' ' ) AS Phone,
phpbb_profile_fields_data.pf_code 'Tag Code',
phpbb_profile_fields_data.pf_student_id 'Student ID', phpbb_users.starve 'Time Remaining (in hours)'
FROM phpbb_profile_fields_data, phpbb_users, phpbb_user_group
WHERE phpbb_profile_fields_data.user_id = phpbb_users.user_id
AND phpbb_profile_fields_data.user_id = phpbb_user_group.user_id
LIMIT 0 , 300

I need all the rows with blank fields under “Team” (which are the result of the “registered” group) removed from the result set. All help is appreciated!

  • 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-11T18:33:37+00:00Added an answer on June 11, 2026 at 6:33 pm

    Add a HAVING clause to the end of your WHERE clause, like this:

    WHERE phpbb_profile_fields_data.user_id = phpbb_users.user_id
    AND phpbb_profile_fields_data.user_id = phpbb_user_group.user_id
    HAVING Team <> ''
    LIMIT 0 , 300
    

    The HAVING clause will make MySQL to do another filtering pass on the query result (including any aggregate results) and then discards those records not matching the HAVING clause.

    You can also have several conditions in the HAVING clause, like this:

    HAVING Team <> '' and Player <> 'First Last'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a forum using phpBB. Now i would like to do something like
I am developing a forum using phpBB. It has a problem with authentication. Users
I recently installed the phpBB app using the one click function (I have a
I have a phpBB forum on my localhost for learning purposes..now I'm trying to
I have a system in which users can register with my forum via the
I have set up a phpbb forum on one of my domains and as
For a personal project, I need to build a forum using PHP and MySQL.
Our forum is based on phpbb3 and for sometime we have been using a
I have an asp.net mvc application, phpBB forum and asp.net webservice that I want
I'm using phpbb 3.0.8 at the moment. It has 3,000 users and around 60,000

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.