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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:28:36+00:00 2026-06-01T11:28:36+00:00

I have 2 tables events and events_visibility events table and the column id –

  • 0

I have 2 tables events and events_visibility

events table and the column

id - title - all

events_visibility and its column

id - event_id - visibile_to - visibile_to_id

here visibile_to used who can see this events. here visibile to maybe Group A, Group B, Group C, so one event can have multiple entry in event_visibility

SELECT Event.*, EventVisibility.* FROM events AS Event 
LEFT JOIN events_visibility AS EventVisibility
ON 
  (Event.id = EventVisibility.event_id) 
WHERE 
 'Event.all' = 1 
 OR 
  (
    'EventVisibility.visible_to_id' = 2 AND 
    'EventVisibility.visible_to' = 159
 )

I want to fetch the unique events based on the visibility and if all, something like this
this query not gave me the proper result.

Can you please take a look.

  • 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-06-01T11:28:38+00:00Added an answer on June 1, 2026 at 11:28 am

    Its maybe you wrote column inside single quotes. Try this

       SELECT Event.*, EventVisibility.* FROM events AS Event 
        LEFT JOIN events_visibility AS EventVisibility
       ON 
       (Event.id = EventVisibility.event_id) 
       WHERE 
       Event.all = 1 
       OR 
       (
        EventVisibility.visible_to_id = 2 AND 
        EventVisibility.visible_to = 159
        )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables, events and photos, which relate together via the 'Event_ID' column.
I have two tables: events_archive and reports. The events table shows all information about
I have 3 tables: events, products and a association table event_products. events:event_id, products: product_id,
I have two tables: events and events_actions events columns: event_id user_id event_name events_actions columns:
I have 2 tables. In one table I add events, ID are auto-increment. The
I have an events table with a 'featureEvent' boolean column. I need to display
I have 2 tables: users user_id | user_name | user_avatar and events event_id |
I have three tables: unmatched_purchases table: unmatched_purchases_id --primary key purchases_id --foreign key to events
I have tables named Events and Log. The Events table comprises of ID, Event
I have 3 mysql tables: events, artists and (artist) descriptions. All of them are

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.