You would use javascript to do this. with PHP
at the top of your page, you'd make some PHP code to handle input:
<? if($_GET['myinput']){
//do your mysql stuff here
}
then do your html for the page:
Here's some example HTML code that creates a form and 'listbox'
<form name=myform>
<select name=mylist onchange=myscript()><! <<change when someone picks an item>
<option value=1>One</option>
<option value=2>two</option>
</select>
</form>
Then you'd include this script in the <head> part of the html>
<script>
/ this script take the selected item and submits it, GET style, to the window's url /
var target=window.document.x.targetdirectory.options[window.document.x.targetdirectory.options.selectedIndex ].value;
if(target){window.location.replace("?myinput="+target);}'
</script>