Click to See Complete Forum and Search --> : Help with dynamic list relations


cotc2001
05-14-2003, 10:56 AM
Can anyone show me the light on this problem im having.
I have two list boxes and a text area, number 2 list box is dependant on the choices of the first and then when the 2nd list box is chosen the result is shown in the text area, all items are dynamic (loaded from mysql).

the problem is when the you make a choice on the 2nd listbox the first reverts back to it's original state.

it may help if I include the link to the page I have it on
http://www.perfume.ie/locator.php

i know the soloution but not how to get there.
currently when you make a choice it returns to the page with the value in the url for example when you choose UK it returns with http://www.perfume.ie/locator.php?country_id=2 and when you then choose the couny it returns with http://www.perfume.ie/locator.php?county_id=89

now i know the soloution is to get it to add the two values together in the url so it reads: http://www.perfume.ie/locator.php?country_id=2&county_id=89 , but that is where I am stuck.

if anyone can help me with this it would be most appreciated (be gentle ima php learner)

forgot to say, the only working (where the result goes into the text area) is the choice UK, shropshire.

additional info is that im using dwmx 6.1 with mysql with php server model

trinitywave
05-19-2003, 06:52 PM
Most likely on the page after you select the country you don't have the value set to the country you want up the first.... Like if you chose United states,,, on the next page you will want your value set to United States as your primary value.... Try that...

Question for you, I see in your search results you have a link to you stores... How do you do that... I am working on trying to do something similar....

cotc2001
05-20-2003, 03:38 AM
Originally posted by trinitywave
Question for you, I see in your search results you have a link to you stores... How do you do that... I am working on trying to do something similar....

I have 3 tables in the database, locate_country, locate_county, locate_store.

locate_country just has 4 countries in it with fields country_id and country_name.

locate_counties has , country_id , county_id and country_name

locate_stores has county_id, store_id, store_name, store_address, store_town, store_county, phone number, fax number etc.

I just filtered the result page using the county_id from the locate_store page.

so it litteraly was, choose country, filter country id from county table, choose county filter county id from store table and that was it.

Im chuffed now that someone has asked me how to do something (made my day that has).