Drilling Down data?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
GeXus
Forum Regular
Posts: 631
Joined: Sat Mar 11, 2006 8:59 am

Drilling Down data?

Post by GeXus »

How would you go about setting up something that is a tiered structure that is drilled down. let me explain.

Say you want to create a form. And based on certain elements in the form or their values, it would then drill down to the next, and so on and so forth.

So for example: If the gender is male, show xyz after submit, if xyz is blahblah show abc after submit.. and so on.

This would all have to be dynamic, so i'm just wondering how you would setup a database to do something like this. I was thinking it could use a tree traversal or something similar, but would like to here if anyone has suggestions.

Thanks!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

It sounds more like you're simply setting up filters, like how you can refine your search parameters in various places.
Begby
Forum Regular
Posts: 575
Joined: Wed Dec 13, 2006 10:28 am

Post by Begby »

There are different ways to do this and it really depends on your data.

If you have a tree structure that is user defined and you want it to go pretty deep, like maybe a nested tree of product categories that you can drill into, then tree transversal might be the way to go.

However if the branches are fixed, like you have a database of cars and want to drill down by Type->Manufacturer->Make->Model->Year, then you want to define your database and setup filters as was suggested.

There is a lot to either one of these, you are going to have to probably do javascript stuff or ajax and possibly some super complex sql queries if you use pre-order tree transversal.
Post Reply