jmcc Posted July 2, 2009 Share Posted July 2, 2009 Hi I have 3 dependent dropdown menus. When I insert their value into my db the values are numeric not the label. I would appreciate any help. my table has 2 fields id_prov and name_prof. drop down code: <php> do { ?> <option value="<php echo $row_province['id_prov']?>"><php echo $row_province['name_prov']?></option> <php } while ($row_province = mysql_fetch_assoc($province)); $rows = mysql_num_rows($province); if($rows > 0) { mysql_data_seek($province, 0); $row_province = mysql_fetch_assoc($province); } ?> </select> Link to comment https://forums.phpfreaks.com/topic/164583-dependent-dropdown-shows-numeric-value-in-db-instead-of-label/ Share on other sites More sharing options...
ldougherty Posted July 3, 2009 Share Posted July 3, 2009 Your select is giving the value of id but display the name.. I'm assuming you want the form value to be the name as well as displaying the name in the drop down? change this: <option value="<php echo $row_province['id_prov']?>"><php echo $row_province['name_prov']?></option> to this: <option value="<php echo $row_province['name_prov']?>"><php echo $row_province['name_prov']?></option> Link to comment https://forums.phpfreaks.com/topic/164583-dependent-dropdown-shows-numeric-value-in-db-instead-of-label/#findComment-868094 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.