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
https://forums.phpfreaks.com/topic/101291-drop-down-menus-with-mysql/
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.

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.