ed01 Posted November 15, 2006 Share Posted November 15, 2006 Hi guys, The problem I'm having below is related to html output from a drop-down menu with the multiple option. I tried posting into the php/mysql section, got 16 reads but no one offered any help - maybe it's more html??Anyway, here's what's got me stumped....I'm having difficulty getting my retrieved database data to display the way I need. I would like to be able to choose the fields to filter out and I'm using a drop-down menu to do so. It works fine except that instead of displaying all of the chosen fields, it only displays the field coresponding to the LAST item in the drop-down list (rather than ALL the selected ones). I should be able to use Ctrl-click to select the fields I want to display. Here's the relevant code. I hope it's enough.Any help would be greatly appreciated!$querycolumns = $_POST['showcolumns'];$query = "select {$querycolumns} from momentum_apex";// Select a sorting criteria.$HTML=<<<HTML<form action="{$_SERVER['PHP_SELF']}" method="post"> <select name="showcolumns" size="3" multiple="multiple"> <option value="role">role</option> <option value="first_name">first_name</option> <option value="last_name">last_name</option> </select> <input name="filter" type="submit" value="Filter now!" /> </form>HTML;echo $HTML; Quote Link to comment https://forums.phpfreaks.com/topic/27311-how-to-set-field-sorting-criteria-using-a-dropdown-menu/ Share on other sites More sharing options...
fenway Posted November 15, 2006 Share Posted November 15, 2006 The question really is whether you want/need to go back to the DB to sort them. Quote Link to comment https://forums.phpfreaks.com/topic/27311-how-to-set-field-sorting-criteria-using-a-dropdown-menu/#findComment-125263 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.