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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:19:36+00:00 2026-05-13T16:19:36+00:00

I am currently trying to build a navigation that is semi built by the

  • 0

I am currently trying to build a navigation that is semi built by the user, basically the user has a primary navigation in which if they click on a category name a block is created on the page for that category. If they click the same link again the block is removed from the page, the website is set up to remember which blocks the user had chosen on there last vist, my issue is getting the menu to display properly.

The way the menu works is that the primary navigation links are built and when the user clicks a link that link gets given a class of “saved” when they click it again the class “saved” is removed.

When the user returns to the site, the primary nav links should have the class saved if there associated block is displaying.

What I need to do is to find a way to get all the links for the primary nav out of the database and check if they links have been chosen by the user in their last vist.

The database structure is like this,

THIS IS TABLE THAT HOLDS MY PRIMARY LINKS

   CREATE TABLE categoryTable (
  categoryId int(11) NOT NULL auto_increment,
  categoryTitle varchar(25) NOT NULL,
  categoryAbstract varchar(60) NOT NULL,
  categorySlug varchar(25) NOT NULL,
  categoryIsSpecial int(1) NOT NULL,
  categoryOnline int(1) NOT NULL,
  categoryDateCreated int(10) NOT NULL,
  dashboardUserId int(11) NOT NULL,
  PRIMARY KEY  (categoryId)
)

AND THIS IS TABLE THAT HOLDS THE INFORMATION ON WHAT BLOCKS THE USER HAS OPEN

    CREATE TABLE userMenuTable (
  menuEntryId int(11) NOT NULL auto_increment,
  categoryId int(11) NOT NULL,
  cookieId varchar(32) NOT NULL,
  PRIMARY KEY  (menuEntryId),
  KEY categoryId (categoryId,cookieId),
  KEY cookieId (cookieId)
)

I tried this query to get all the categories that are not in the userMenuTable but it does not work,

SELECT *
FROM `categoryTable`
WHERE `categoryId`
NOT IN (
SELECT `userMenuTable`.`categoryId`
FROM (`userMenuTable`)
LEFT JOIN `categoryTable` ON 
`categoryTable`.`categoryId` = `userMenuTable`.`categoryId`
WHERE `userMenuTable`.`cookieId` = '{$cookieId}')

I am obviously doing something wrong can anybody shed any light on my problem?

  • 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-13T16:19:36+00:00Added an answer on May 13, 2026 at 4:19 pm

    Why are you using NOT IN in your query above? It seems IN would be more appropriate. Anyway, here’s a simpler/more efficient query that should work:

    SELECT cat.*
    FROM userMenuTable user
    LEFT JOIN categoryTable cat ON cat.categoryId = user.categoryId
    WHERE user.cookieId = '{$cookieId}'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently trying to build a simple component which should monitor, if the user
I am currently trying to build on TeamCity, which uses Microsoft.Office.Interop dll. This will
I'm currently trying to build an application that inherently needs good time synchronization across
I am currently trying to build a little widget that will retrieve a list
I am currently trying to build some test code that uses Google C++ Test
I'm currently trying to build a code which is supposed to work on a
Currently, I'm trying to build a game with UIkit that consists of the three
i am currently trying to build a little webapp that uses Spring, Hibernate and
I am currently trying to build a cakephp app that will list items from
I've been given a design to build that uses a tabbed navigation structure, which

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.