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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:09:02+00:00 2026-05-29T08:09:02+00:00

I have a group feature on my website that allows 1 user to put

  • 0

I have a group feature on my website that allows 1 user to put the userids of any of his or her friends into an invitedusers column. I need to do an SQL search to determine whether the logged-in user’s ID has been stored in any invitedusers columns by his or her friends.
How can I do this with an sql search?

EX: My column is invitedusers, and inside that column is stored the following, (234,394,479)
When Userid 234 has logged in, I need to search to see whether any columns have userid 234 stored inside the invitedusers column.

SELECT userid, name... FROM mytable WHERE invitedusers = ?

*I looked at the SQL IN operator along with FIND_IN_SET but no help with either.*

  • 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-05-29T08:09:03+00:00Added an answer on May 29, 2026 at 8:09 am

    Assuming that you’re really using 234,394,479 as value of one column (you at least should use ,234,394,479, to be able to do WHERE invited LIKE '%,234,%' in your query) you should rebuild your user tables, remove field invited_users and create table like this:

    CREATE TABLE invited_users (
      id INT AUTO_INCREMENT,
      owner_id INT, -- Who's input it is
      target_id INT, -- What's the target user
      PRIMARY KEY ( id),
      UNIQUE ( owner_id, target_id),
      -- Indexes (FOREIGN KEYs!) to users table
    );
    

    And than just select list of users who invited user 234 with query:

    SELECT users.id, users.name
    FROM invited_users
    INNER JOIN users ON invited_users.owner_id = users.id
    GROUP BY users.id
    WHERE invited_users.target_id = 234
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a feature which allows the user to create projects and view it
I'm writing a GUI application that will have a user log in feature. Each
JUnit 4.8 contains a nice new feature called Categories that allows you to group
I have group of stored procedures with names like 'somename_%'. Are there any way
I have a group of checkboxes that I only want to allow a set
I have a group of buttons that should act like toggle buttons, but also
I have a group of radio buttons in my Swing application that have a
I have a group of borders that make up a small map. Ideally I'd
My website is growing. I need to partition feature sets to different group of
I have a web app that create groups. Each group gets their own discussion

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.