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

  • Home
  • SEARCH
  • 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 4271892
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:30:14+00:00 2026-05-21T07:30:14+00:00

I am trying to work out how to implement a new piece of functionality

  • 0

I am trying to work out how to implement a new piece of functionality on my website. My site allows people to download things uploaded by members of a group. The new piece of functionality will allow 1 member of the group to be a ‘super’ user whos uploads cannot be downloaded. So at the moment my query (more or less) is –

SELECT * FROM uploads WHERE group = $groupid

I am thinking I will store the ‘super’ status of the member in the ‘members’ table so will probably look up this to get the member id of the super member before doing the query.

$all_group_members = SELECT members FROM groups WHERE group_id = $groupid
$super_member = SELECT memberid FROM members WHERE memberid IN ($all_group_members) AND super_status = 1 

Then modify the query to be –

SELECT * FROM uploads WHERE group = $groupid AND uploader ! = $super_member

However there may not always be a super member in a group, so my question is is there a more effective way to do this, for example store the super members ids in the session cookie? What about storing the super user id in the group table – still involves doing a query –

SELECT super_user FROM groups WHERE groupid = $group_id 

But atleast thats one less query.

Is there just no way around this – I know that there will only be a super user about 5% of the time so 95% of the time this will be wasted query. Perhaps the session cookie could store a group_has_super_user variable.

Any other ways of doing this that im missing?

thanks

  • 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-21T07:30:15+00:00Added an answer on May 21, 2026 at 7:30 am

    I assume, other group members can’t download anything from my group’s stuff. So, simply add a downloadable field to the uploads, and set it to

    • 1, if a simple member has uploaded it, or
    • 0, if a super member has.

    Then the only query you have to run is:

    SELECT * FROM uploads WHERE group = $groupid AND downloadable != 0
    

    Also, if the membership is changing (e.g. someone else gets the super right), these flags should be recalculated in the group.

    Don’t forget to create index for (or set the primary key to) groupid + downloadable (or downloadable + groupid)!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been trying to work out how to implement Church-encoded data types in Scala.
I am trying to work out a code sample to demonstrate the debugging functionality
Trying to work out this whole web part personalisation, and trying to implement it
I'm new to MVC and I'm trying to figure out how to implement business
I am trying to implement a password reset functionality on my company website where
I am trying to implement Google Check out (GCO) on a new server, the
I am trying work out with MERGE statment to Insert / Update Dimension Table
I am trying to work out the best database model for the current setup:
I am trying to work out how to get the value of table cell
I'm trying to work out a way of passing the web current http context

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.