MySQL Forums
Forum List  »  Newbie

Re: Use selected option from select command
Posted by: laptop alias
Date: September 14, 2009 01:22AM

This is primarily a PHP/HTML question, so one of those forums would possibly provide a more authoritative answer, but...

Option-selects are a feature of forms.

Forms usually include a 'method' (GET or POST), an 'action' (usually the page that the form parser resides upon), and a 'Submit' button.

So, if using the GET method, your form might look something like this:
<form method='get' action='my_form_parser.php' name='form1'>
<select name='my_option'>
<option>1</option>
<option>2</option>
<option>3</option>
</select>
<input type='submit' name='submit' value='submit'>
</form>
and your parser might begin with a statement like:
<?php
$my_option = $_GET['my_option'];
$query = "SELECT details FROM my_table WHERE account_no = $my_option";

You may also want to look at AJAX methods.

Options: ReplyQuote


Subject
Written By
Posted
Re: Use selected option from select command
September 14, 2009 01:22AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.