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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:29:59+00:00 2026-06-11T18:29:59+00:00

I am creating a product catalogue which will be browsed through database queries with

  • 0

I am creating a product catalogue which will be browsed through database queries with the results displayed in a div, without page refresh-via ajax.

Category examples would be:

Home
Health
Entertainment

There are also subcategories for each category, i.e:

HOME:
Garden
Furniture
Plumbing
Etc.

I want to make a little directory thing that shows exactly where they are, something like:

Home >>> Garden >>> Lawn care

With each of those as a clickable link to take the person back to that specific query level.

My code is 1 .php document, involving a query and code to output the query. If output is clicked on, it triggers an ajax script which points back to and reruns the same query/output, but with different results.

This being said, i dont know how i would create a way to store and display the directory path. That i mentioned above.

I was thinking of some way that takes the category that was clicked on and passes it through the url so that the php has the value when it reloads. And then i work that variable into a clickable directory link. But the problem is I’m not sure how to do that for multiple layers.

i.e.
If someone just clicked on “garden” i could pass the garden variable through and use that in the nav, but then if someone clicked on “lawn care” i wouldnt be sure how to keep the “garden” variable because the variable i brought over via the url would now read “lawn care.”

I feel like it has something to do with dynamically adding and storing the cumulative values in an array, but I’m really out of ideas…

  • 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-11T18:30:00+00:00Added an answer on June 11, 2026 at 6:30 pm

    From what you’ve described, it sounds like you want to implement bread crumbs/categories rather than directories.

    If this is the case, you’d basically need to create a Categories table in your database like so:

    Categories
    id | parent_id | name
    1  | 0         | Home
    2  | 1         | Garden
    3  | 1         | Furniture
    4  | 1         | Plumbing
    5  | 2         | Lawn Care
    

    This would equate to a hierarchy like the following:

    • Home
      • Garden
        • Lawn Care
      • Furniture
      • Plumbing

    So if I want to have a product show, for instance, in Home > Garden > Lawn Care, I’ll need to link the product to Category #5 (Lawn Care). Then I need to develop a function to do a little while loop that figures out the parent structure from there. It will need to loop until it doesn’t find a parent (or until parent_id = 0). In other words, it would go:

    I'm in Lawn Care. Does Lawn Care have a parent?
    Yes -> Garden. Does Garden have a parent?
    Yes -> Home. Does Home have a parent?
    No -> End.
    

    There are a number of ways to implement this, which is why I left specifics out.

    Alternatively, you could just do this calculation on save of the product or category so it can map out the hierarchy the one time instead of every time (saving on calculations), but this would be a very simple solution that could work for a large number of products.

    The benefit to doing it this way is that you can also implement product lists based on the category you’re in, and from another perspective, you can create product counts per category.

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

Sidebar

Related Questions

I'm creating a product page that requires the price to update when the quantity
I am creating a search page where we can find the product by entering
I am creating a form designer. It will generate PHP code which will produce
I am creating a product that as end result will/can create e.g. 10 .sql
I have a featured product selection in pHtml, which instead of creating an attribute
I am thinking of creating a product based on the Visual Studio Shell (primarily
Assume for a moment that you are creating a commercial product for SharePoint. This
Opensource, free XF.Network analogs (product for creating High Performance TCP/IP Server using C#.NET )
I have been trying to use routes.rb for creating a URL /similar-to-:product (where product
I will be creating an Application that will be showing the Products in a

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.