ranura Posted May 13, 2012 Share Posted May 13, 2012 I have 10 tables in my database. I want load these 10 table names into a drop-down list. If a user selects a value form the drop-down list, a form should be displayed with related to the table. (form fields should be appropriate table's column headers) When user fill the form and submitted, data should be saved in the selected table. Give me a code example to do this. Quote Link to comment https://forums.phpfreaks.com/topic/262476-load-form-dynamically-based-on-a-dropdown-selection/ Share on other sites More sharing options...
spiderwell Posted May 13, 2012 Share Posted May 13, 2012 what code have you got so far? Quote Link to comment https://forums.phpfreaks.com/topic/262476-load-form-dynamically-based-on-a-dropdown-selection/#findComment-1345120 Share on other sites More sharing options...
ManiacDan Posted May 13, 2012 Share Posted May 13, 2012 We don't do free work here, write this yourself and come back when you get stuck. Or download PHPMyAdmin. Quote Link to comment https://forums.phpfreaks.com/topic/262476-load-form-dynamically-based-on-a-dropdown-selection/#findComment-1345126 Share on other sites More sharing options...
awjudd Posted May 13, 2012 Share Posted May 13, 2012 Or pay someone to make it for you. ~awjudd Quote Link to comment https://forums.phpfreaks.com/topic/262476-load-form-dynamically-based-on-a-dropdown-selection/#findComment-1345128 Share on other sites More sharing options...
Dusaro Posted May 13, 2012 Share Posted May 13, 2012 Access the database and display all table names found. In the form use the POST method. On the second page after the table has been selected and the first form submitted, use $table = $_POST['Dropdown Value']; if ($table == 0) { Do This } elseif ($table == 1) { Do This } etc etc. I know this is not the best way and i have not tested it. Quote Link to comment https://forums.phpfreaks.com/topic/262476-load-form-dynamically-based-on-a-dropdown-selection/#findComment-1345197 Share on other sites More sharing options...
premiso Posted May 14, 2012 Share Posted May 14, 2012 Oh HAI! Quote Link to comment https://forums.phpfreaks.com/topic/262476-load-form-dynamically-based-on-a-dropdown-selection/#findComment-1345211 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.