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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:46:59+00:00 2026-05-27T23:46:59+00:00

I have a quick question in regards to the approach to displaying products on

  • 0

I have a quick question in regards to the approach to displaying products on an e-commerce package I am putting together. The problem that I facing is that I would like visitors of the site narrow their search.

For example, a use case would be:

  1. A Visitor is currently browsing a season of products (eg. Summer Collections)
  2. He / She should then be able to filter by category and brand within that season, so for example they might decide that they only want to see Pants from Clothes Galore.

The problem, I ma facing is that doing a single SQL query in order to find products that match all three of these factors (so the product is in the summer collection, is a pair of pants and made by clothes galore). The thing that makes this overly difficult is that products can be in multiple categories and seasons. So there would need to be an insane amount joins in order to grab the right result.

My database structure is as follows:

product -> product_category <- category
product -> product_season <- season
product <- brand (a product can only be made by one brand)

Hope someone can share their wisdom on this…

  • 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-27T23:47:00+00:00Added an answer on May 27, 2026 at 11:47 pm

    If you have a big catalog, you might be better to use Apache Solr ( http://lucene.apache.org/solr/ ). Otherwise, there are a few approaches.

    You don’t need the overhead and straight SQL isn’t that insane, will perform reasonably well:

    SELECT product.*
    FROM product
    LEFT JOIN product_category
    LEFT JOIN category
    LEFT JOIN product_season
    LEFT JOIN season
    WHERE season = ? AND category = ?
    

    Alternatively, If you don’t like the number of rows returned, you can aggregate the category and season into the product table (new columns), then use like queries to find things:

    SELECT product.*
    FROM product
    where product.categories like '% category %'
      and product.seasons like '% season %'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a quick question that I can't seem to find online. I am
I have a quick question regarding memory management that I am not quite sure
Have a quick question about what would be the best way to implement iterators
I have a quick question that I just can't seem to figure out even
I have a quick question with some jQuery where I'm running into a problem.
I have a quick question that I need some help with if possible. Am
I have a quick question about a preg_replace problem I have. I am just
I just noticed that live() is already deprecated in jQuery. I have quick question
I have a quick question that hopefully someone has worked through before. In the
I have a quick question that I hope has a quick and clear answer.

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.