Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
A join in the query won't work in this case, (as the example you posted) as there will be multiple entries in the USER_GROUPS table. So you can only join to one of them. So this won't be possible using the same query. It'll only join to one row in the USER_GROUPS table, probably the first entry. But the users will have an entry in this table for each usergroup they belong to.

You'd either need
a) To do an additional query per post to the USER_GROUP table to grab all the groups that the user belongs to. (That'll add alot of queries - NOT RECOMMENDED)

b) Or you'll need to devise a method to store the image that needs to be displayed in the USER_PROFILE table, so you can grab the image with the rest of the profile info and display it using the same query.

c) You could probably grab all the contents of the USER_GROUP table and store them in an array, then compare against this when you display each post, see if the user is in the group. This would be just one additional query on the page. But if you have alot of users or alot of groups, the array could be sizeable and hog up alot of memory.

I've seen other software products which are structured exactly like the new UBBThreads, and option b is really the way you'd have to go.

Sponsored Links
Entire Thread
Subject Posted By Posted
Checking user group for group icons in showflat Calpy 01/15/2007 6:08 AM
Re: Checking user group for group icons in showflat Calpy 01/17/2007 12:51 AM
Re: Checking user group for group icons in showflat AllenAyres 01/17/2007 2:32 AM
Re: Checking user group for group icons in showfla Calpy 01/17/2007 11:09 AM
Re: Checking user group for group icons in showfla Gizmo 01/17/2007 12:00 PM
Re: Checking user group for group icons in showfla AllenAyres 01/17/2007 4:06 PM
Re: Checking user group for group icons in showfla Gizmo 01/17/2007 4:27 PM
Re: Checking user group for group icons in showfla AllenAyres 01/17/2007 8:57 PM
Re: Checking user group for group icons in showfla Calpy 01/18/2007 12:01 AM
Re: Checking user group for group icons in showfla Gizmo 01/18/2007 4:42 AM
Re: Checking user group for group icons in showfla JoshPet 01/18/2007 5:38 AM
Re: Checking user group for group icons in showfla Calpy 01/25/2007 8:12 AM
Re: Checking user group for group icons in showfla JoshPet 01/26/2007 3:29 AM
Re: Checking user group for group icons in showfla Deejay23 01/26/2007 7:56 PM
Re: Checking user group for group icons in showfla Calpy 04/02/2007 3:40 AM

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
hatter
hatter
USA
Posts: 69
Joined: January 2001
Forum Statistics
Forums63
Topics37,575
Posts293,932
Members13,824
Most Online6,139
Sep 21st, 2024
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,835
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2025 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.1
(Snapshot build 20240918)