Jump to content

PHP MYSQL trouble with getting the data i want


nevesgodnroc

Recommended Posts

This may be more of a Mysql question than a php question but here goes.

 

I have a table of Types that has two columns tht i am concerned with the type column and the name column that looks somethinglike this:

 

Types:                  Name:

article                  politics

article                  DIY

article                  talk

product                tools

product                toys

 

 

where there can be a variable number of Types and a variable number of names per type.

 

what i am trying to do is generate a pair of dynamically linked dropdown boxes where the first box will contain a list of the available types. And the second box will dynamically be filled with possible options where the type/name relationship is equal to the type selected in box 1

 

I hope that explanation wasn't to confusing. I have the javascript figured out to generate the options the part that is giving me trouble is generating the following lists.

 

list of types:

type[0][0] = article

type[1][0] = product

 

list of names of articles:

type[0][1] = politics

type[0][2] = DIY

type[0][3] = talk

 

list of names of products

type[0][1] = tools

type[0][2] = toys

 

so you see i need to generate a script to make a list of variable length for box 1 and a variable number of entries in the variable number of lists for box 2.

 

any help would be great.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.