Jump to content

Drop down menu's with MySQL


Eiolon

Recommended Posts

I'm looking for a solution that allows me to have two drop down menus.  The first menu will select from a table called "years" and the second menu will select from a table called "accounts".

 

If I select the year "2007" I want the second box to show all the accounts in 2007.  If I select 2005, I want it to show only 2005 accounts, and so on...

 

The tables have already been setup so the accounts reference the corresponding years.  I am just looking for a javascript solution so it can be implemented.

 

Thanks for your help!

Link to comment
Share on other sites

YEARS

 

id int not null primary key auto_increment,

label varchar(25) not null,

start_date date not null default '0000-00-00',

end_date date not null default '0000-00-00',

budget_amount decimal(10,2)

 

ACCOUNTS

 

id int not null primary key auto_increment,

name varchar(100) not null,

budget_amount decimal(10,2),

year_id int not null default '0'

 

year_id references id in YEARS table

 

So when the year 2007 is selected it will list all accounts made for 2007.

Link to comment
Share on other sites

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.