wawanye
Posts: 2
|
| Posted: 11/13/2007, 8:42 PM |
|
Hello all..
I have one problem. I think some of you found the same problem as mine.
I want to develop a simple website that provide list of directories..which contain three levels (Country, Region, State), and 1 State have many City in another table. I managed to develop it using Directory Builder.
The relationship of the database goes like this:
Country (category_id(PK), name, parent_category_id)
City (city_id(PK), name, total, category_id(FK))
So 1 category_id in Country Table have many city_id in City Table (1:M) = this link is only for Level 3 in Country Table which have many City in City Table.
The data in Country Table contains the three levels like this:
category_id - 1 - 14 = Level 1 = list of countries
category_id - 15 - 25 = Level 2 (Level 2 relates to Level 1 above) = list of regions
category_id - 26 - 40 = Level 3 (Level 3 relates to Level 2 above) = list of states
as we can see from the sample of using Directory Builder, parent_category_id will refer to the category_id id so, meaning that this table relates to itself.
So.. my BIG PROBLEM was that.. how could I change the link from Third Level, so that it will display the list from City Table that relates to specific id from Country Table.
Example:
Main > Country > Region A in Country A > State in Region A in Country A >
State 1 State 2 State 3 (etc....)
When I click on State 1, I want the link will open another page called list_city.asp and display all the City in State 1.
The reason why I didnt combine City record into Country table, because in City table has more fields.
Please help me.. Thanks...
|
 |
 |
|