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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:54:24+00:00 2026-06-04T17:54:24+00:00

I have a feeling this is really simple. Here’s the deal: I have a

  • 0

I have a feeling this is really simple. Here’s the deal: I have a table with three columns. I want to take all the values in one of the columns and turn that into a list. I want to do this so I can transverse through the list. Each value in the list corresponds to a username. I want to take that username to access info about a user. Using this info, I can check which faculty the user is in and sort accordingly. This is what I’ve come up with:

    function get_users_by_faculty($faculty) { 
    global $connection;
    $query = "SELECT * FROM owner";
    $user_set = mysql_query($query); // ERROR could not establish link to server
    confirm_query($user_set);  
    foreach($user_set as $user) { //ERROR invalid argument
        $userFaculty = get_info_by_id($user["ownerId"], "ou"); 
        if($faculty == $userFaculty){
            return $user["name"];
        } else {
            return NULL; 
        }
    }

I’ve been quite stuck on this for a few hours.

  • 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-04T17:54:26+00:00Added an answer on June 4, 2026 at 5:54 pm

    I don’t know your fields names, but I think you could do that with an sql query.

    something like that :

    SELECT user.id,user.name, faculty.name 
    FROM user inner join faculty on faculty.id = user.faculty_id
    WHERE faculty.id=?
    

    You should replace ? with your faculty id.

    If you want a list of user names, you can use group concat :

    SELECT GROUP_CONCAT(user.name SEPARATOR ';') 
    FROM user inner join faculty on faculty.id = user.faculty_id
    WHERE faculty.id=?
    GROUP BY faculty.id
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the feeling this has a really simple solution and I'm just suffering
I have a feeling I'm going about this all wrong. But anyway. I have
I have a really strong feeling that this question will either be closed or
I have a feeling this XML is not valid, can someone please explain why?
I have a feeling this is a stupid question but I can't find the
I have a feeling that this query is pretty easy to construct, I just
I'm maintaining a CMS where I have this feeling it was made in the
I have the feeling the answer to this question is no but I figured
I have a feeling I am completely borking this MySQL query but I'll ask
I somehow have the feeling that modern systems, including runtime libraries, this exception handler

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.