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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:49:34+00:00 2026-05-20T03:49:34+00:00

I have a crossreference table owner_meeting_crossref with a column (owner_id) for owner IDs and

  • 0

I have a crossreference table owner_meeting_crossref with a column (owner_id) for owner IDs and column (meeting_id) for meeting IDs that the owner has access to.

My php script is sent an array of meetings, and I know the current user ID is $current_user_id. How can I efficiently check that the user (owner) has access to the meeting IDs sent in?

  • 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-20T03:49:35+00:00Added an answer on May 20, 2026 at 3:49 am

    One option would be to fetch the meetings from the list that the user has access to, then calculate the difference.

    $meetingStr = implode(',', array_map('intval', $meetings));
    $accessibleMeetingQuery = $db->prepare("
        SELECT meeting_id 
          FROM owner_meeting_crossref 
          WHERE owner_id=:uid AND meeting_id IN ($meetingStr)
    ");
    $accessibleMeetingQuery->execute(array(':uid' => $current_user_id));
    $accessibleMeetings= $accessibleMeetingQuery->fetchAll(PDO::FETCH_COLUMN);
    $inaccessibleMeetings = array_diff($meetings, $accessibleMeetings);
    

    Another would be to do it all from SQL

    SELECT m.id 
      FROM meetings AS m
        LEFT JOIN owner_meeting_crossref AS om 
          ON m.id=om.meeting_id AND om.owner_id=:uid
      WHERE m.id IN ($meetingStr)
        AND om.meeting_id IS NULL
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ItemComments table that has one column with a foreign key constraint
I have Plan table that has a one to many relationship with a Price
I have a cross reference table RolePrivilege that has FK to Role and Privilege
I have a table of products in my sql database. Each product has an
I have two enums that cross reference each other. Each one has a constructor
I have a cross reference table that looks like this: id document_id subject_id 1
I Have Database that contains 4 tables TABLE TBLCARTITEM (CART_ID, ITEM_ID, PROMOTION_ID, many more
I have two simple tables in my database. A card table that contains Id,
I have a SampleDB that contains 3 tables. Table Employees (EmployeeID, EmployeeName) Table Projects
I have a pivot table with some data that im trying to reference with

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.