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 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" 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); Link to comment https://forums.phpfreaks.com/topic/160254-question-about-select-menu/#findComment-845659 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.