Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.