Jump to content

Recommended Posts

Hello;

I have to three databases; one for groups; one for users; and one for users-groups-relation (relation)

The relation database has three fields; id, user_id, and groups.. I save group_id's like "1, 2, 3, 4" etc.

Is there any way to use the IN function to get the groups which id's is in the relation.groups field.?

Link to comment
https://forums.phpfreaks.com/topic/128099-solved-use-of-in-to-relate/
Share on other sites

You shouldn't store IDs in a comma separated field ever.  You should create a separate table which relates the two other tables and requires a simple JOIN to get to work smoothly.  Read up on 'database normalization' to see what I mean.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.