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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:09:47+00:00 2026-05-20T05:09:47+00:00

Well guys, I have three tables here, menu, user and access. For simplifying let’s

  • 0

Well guys, I have three tables here, menu, user and access. For simplifying let’s consider:

  • User table has one column: id
  • Menu table has 5 columns: id, title,
    url, lft, rgt
  • Access table has 4 colums: id,
    user_id, menu_id, access

I’m using SitePoint’s Modified Preorder Tree Traversal to display the menu:

SELECT id, title, lft, rgt, url FROM menu WHERE lft BETWEEN 3 AND 49 ORDER BY lft ASC;

In the access table, the access column is having values of 0 or 1. At the same time, on a given page, I have the id value of User table, say $id.

The idea is modify the above select to show only those menu items, where in the corresponding Access table, the access column is set to 1. Where access = 0, the menu doesn’t turn up for the given user.

Have I been clear? Thanks in advance for any help.
Cheers.

  • 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-20T05:09:48+00:00Added an answer on May 20, 2026 at 5:09 am

    select id, title, lft, rgt, url from menu join access on (menu.id = access.menu_id) where (lft between 3 and 49) and access.access=1 order by lft asc;

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

Sidebar

Related Questions

Well guys, here i am. In three days i couldn't resolve this problem. (I'm
I have three columns in a table: score status No. 1, 2, 1 0,
Hi guys thanks for pay attention to this. Well im trying to replace every
Hey guys, I'm using Twitter's PHP API, called twitterlibphp , and it works well,
Well, my website can not redirect to https://www.facebook.com/QuaFootSpa from http://quafootspa.com/ I have tried redirection
well i have a configuration like this in the components part of my config
Well, I have a application which somehow requires some system resources, but how do
Hey guys, im not well versed in dealing with asynchronous design patterns, and im
I have a form that the user is going to interact with, by updating,
I have a data table that contains data which is technically a tree structure,

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.