Eiolon Posted April 15, 2008 Share Posted April 15, 2008 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! Quote Link to comment https://forums.phpfreaks.com/topic/101291-drop-down-menus-with-mysql/ Share on other sites More sharing options...
zenag Posted April 16, 2008 Share Posted April 16, 2008 ur database structure pls... Quote Link to comment https://forums.phpfreaks.com/topic/101291-drop-down-menus-with-mysql/#findComment-518218 Share on other sites More sharing options...
RichardRotterdam Posted April 16, 2008 Share Posted April 16, 2008 your solution would be ajax related. when you selected a value form the first pulldown you will have a php action to fetch records from your database Quote Link to comment https://forums.phpfreaks.com/topic/101291-drop-down-menus-with-mysql/#findComment-518393 Share on other sites More sharing options...
Eiolon Posted April 16, 2008 Author Share Posted April 16, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/101291-drop-down-menus-with-mysql/#findComment-518513 Share on other sites More sharing options...
haku Posted April 16, 2008 Share Posted April 16, 2008 As DJ Kat said, you need AJAX to be able to do this. Quote Link to comment https://forums.phpfreaks.com/topic/101291-drop-down-menus-with-mysql/#findComment-518542 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.