sandhya Posted February 27, 2008 Share Posted February 27, 2008 Id like to load a drop down list from a mysql database and i did it. But that selected value is not passing to the next form. Anyone can help me please? Link to comment https://forums.phpfreaks.com/topic/93292-passing-the-selected-value-form-a-dropdown-list-from-a-database/ Share on other sites More sharing options...
timmy0320 Posted February 27, 2008 Share Posted February 27, 2008 Did you view the source to make sure the value's were posting correctly? Link to comment https://forums.phpfreaks.com/topic/93292-passing-the-selected-value-form-a-dropdown-list-from-a-database/#findComment-477830 Share on other sites More sharing options...
sandhya Posted February 27, 2008 Author Share Posted February 27, 2008 ya i'm giving the code i used here. <select name="empid" > <option value="" selected>Select Empolyee ID</option> <?php while ($recs = mysql_fetch_array($empids)){ $id = $recs['id']; ?> <option value="<? $id ?>"> <? echo $id; ?></option> <? } // end while ?> </select> on submitting this form the value passed is the last row of the selection evry time. Link to comment https://forums.phpfreaks.com/topic/93292-passing-the-selected-value-form-a-dropdown-list-from-a-database/#findComment-477832 Share on other sites More sharing options...
cyrixware Posted February 27, 2008 Share Posted February 27, 2008 can you please post here in the drop down list part? Link to comment https://forums.phpfreaks.com/topic/93292-passing-the-selected-value-form-a-dropdown-list-from-a-database/#findComment-477834 Share on other sites More sharing options...
cyrixware Posted February 27, 2008 Share Posted February 27, 2008 <select name="empid" > <option value="selected">Select Empolyee ID</option> <? while ($recs = mysql_fetch_array($empids)){ // $id = $recs['id']; ?> <option value="<?=$recs['id']; ?>"> <?=$recs['id'];?></option> <? } // end while ?> </select> take note also in this part: <option value="" selected>Select Empolyee ID</option> Link to comment https://forums.phpfreaks.com/topic/93292-passing-the-selected-value-form-a-dropdown-list-from-a-database/#findComment-477837 Share on other sites More sharing options...
sandhya Posted February 27, 2008 Author Share Posted February 27, 2008 thanks. its worked. Link to comment https://forums.phpfreaks.com/topic/93292-passing-the-selected-value-form-a-dropdown-list-from-a-database/#findComment-477984 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.