Hi so I'm making a site for sneakers. A person can sign up and say they like Nikes, Vans, Reeboks, etc.

I then have it where you can make a group for people who like certain sneakers as well. So the group can say they like Nikes, Vans, Reeboks, etc.

I want to get the group likes (Nikes, Vans, Reeboks, etc.) and search the users database for anyone who likes Nikes, Vans, or Reeboks.

I can get it where it searches only one like, but can't do it for multiple.

Recommended Answers

All 5 Replies

|USER|LIKE|
______________
|JOHN| NIKE |
|JOHN| VANS |
|JOHN|REEBOKS|
|BRAD| NIKE |
|BRAD| VANS |
|BILL|REEBOKS|
|MIKE| NIKE |

|GROUP| TAGS|
______________
|GRO1| NIKE |
|GRO1| VANS |
|GRO1|REEBOKS|
|GRO2| NIKE |
|GRO2| VANS |
|GRO3| NIKE |

So The ADMIN for gro2 would see
John
Brad
MIKE

Member Avatar for LastMitch

@thecameraman

Can you provide a Select & Where code so we can understand better.

$links2 = "SELECT * FROM go_website_users 
LEFT JOIN go_users_activities_join ON (go_users_activities_join.user_id = go_website_users.ID) 
WHERE go_website_users.ID !='$uuserid' AND go_users_activities_join.activity_id = '$activityidee' 
ORDER BY friends DESC";

I want go_users_activities_join.activity_id = '$activityidee' to search all the group joined from the query below

$links = "SELECT * FROM sneaker_groups 
LEFT JOIN group_sneakers_join ON (group_sneakers_join.group_ID = sneaker_groups.ID) 
WHERE group_sneakers_join.activity_id = '$_GET['id']'";

Thank you! The LEFT JOIN didn't work when I tried it but the JOIN worked!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.