hno Posted May 30, 2009 Share Posted May 30, 2009 HI I have a select (combo box) in my form and I want when the user submit the form I get the selected number of combo box it means the number of selected row .How can i do that? thanks Quote Link to comment https://forums.phpfreaks.com/topic/160254-question-about-select-menu/ Share on other sites More sharing options...
Garethp Posted May 30, 2009 Share Posted May 30, 2009 in the <option> tag, set value="whatever row number this is" Quote Link to comment https://forums.phpfreaks.com/topic/160254-question-about-select-menu/#findComment-845657 Share on other sites More sharing options...
Michdd Posted May 30, 2009 Share Posted May 30, 2009 You mean you want to grab the row from the database that corresponds to the option they selected? If so, you can do something like this: $id = $_POST['name']; //whatever the name of your combobox in the form is. $result = mysql_query('SELECT * FROM `table` WHERE id="' . $id . '"'); $row = mysql_fetch_assoc($result); Quote Link to comment https://forums.phpfreaks.com/topic/160254-question-about-select-menu/#findComment-845659 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.