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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:47:41+00:00 2026-06-01T00:47:41+00:00

I have a database full of items, which should be searchable by any or

  • 0

I have a database full of items, which should be searchable by any or all of the following criteria:

item_id, supplier, price range, color

Now, that’s easy – user’s selection of checkboxes is POSTed, and I turn it into appropriate query.

QUESTION: how to make it so that search dynamically modifies itself. What I mean is – if you select a certain price range, all suppliers and colors that don’t conform to it are removed from selection, and any selected items are deselected as well.

Likewise, if user checks certain color, all suppliers that don’t offer it, and all price ranges that don’t have it are removed from selection. And also all items a user may have previously selected, but which are not in that color.

Sub-question: is this even good idea at all, if you’re against it, please let me know why?

NOTE: Architectural advice is all I need, how to approach it, and answer is HIGHLY appreciated, I’m bashing my head over this for 2 days.

Won’t refuse code as well, and it may be in any language or pseudo code, I need to decode the way of thinking here.

EDIT: Here’s an example – by clicking any of the search criteria on the left, you affect search results:

http://www.wanajob.com/emploi?search=informatique&fpc=&fpr=

  • 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-01T00:47:42+00:00Added an answer on June 1, 2026 at 12:47 am

    I’m not an expert on facets so I defer to Brent’s answer in that direction but what you are describing is fairly easy to implement in MySQL for your basic search data.

    Let’s say the customer searches on “red” being the colour. You could then construct the list of suppliers and price ranges within the search results like this

    SELECT DISTINCT supplier FROM items WHERE color = 'red';
    SELECT DISTINCT price_range FROM items WHERE color = 'red';
    

    Note that these would have to be separate queries as

    SELECT DISTINCT supplier,price_range FROM items WHERE color = 'red';
    

    would return all DISTINCT combinations of the two fields.

    If you require a COUNT of each criteria then you can use GROUP BY

    SELECT supplier,COUNT(*) FROM items WHERE color = 'red' GROUP BY supplier;
    SELECT price_range,COUNT(*) FROM items WHERE color = 'red' GROUP BY price_range;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a MYSQL full text search, matching against items in my database, which
I have a database full of customer data. It's so big that it's really
I have a database full of small HTML documents and I need to programmatically
I have a database full of Asian-character filled records (Chinese, Japanese, and Korean) alongside
I have a database full of text fields that look like this: (paragraph of
I have a database full of two-dimensional data - points on a map. Each
I have a database table full of some really ugly and messy data. In
I have an sqlite database full of huge number of URLs and it's taking
I have a database table full of time points and experimental values at those
Problem: I have a symfony project with a database full of production data I

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.