Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2010
    Posts
    5

    Unanswered: Making a car-filter - An advanced query you'll never figure out :S

    I'm creating a webshop where I want to show a set of products based on what car is selected, as an addition to the regular product groups.

    I now have several tables:
    product
    group
    car_make
    car_model
    car_filter
    session_car_filter

    The session_car_filter table have the following coloumns:
    car_make, car_model, car_year and session_id

    The car_filter table have:
    car_make, car_model, from_year, to_year, product_id

    The product table have:
    product_id, group_id, universal

    The group table have
    group_id

    Now I want to make my website set one or several rows in the session_car_filter which is all good. The filters in the session must match up with the car_filter table and based on that show the products that is ment for this car only. AND if the product has "universal=1" in the table it should show no matter what the filters says. So I want to show all products with universal=1 and the products that match up with the filters.

    Don't know if I've explained it good enough, but I've tried playing with joins over and over, but can't seem to figure it out.

    Any good ideas?

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by skoTner View Post
    Now I want to make my website set one or several rows in the session_car_filter which is all good.
    huh? make your website set some rows which is all good???

    Quote Originally Posted by skoTner View Post
    Don't know if I've explained it good enough
    sorry, nope

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •