ThisIsMyName Posted May 7, 2009 Share Posted May 7, 2009 Wondering if it's possible to create a form with a dropdown that displays a list of text options but passes an INT to MySQL, e.g, menu contains a list of cities but I update the DB with a City_ID. Is there a way to define $Miami=$1234 and put $Miami in the HTML form variable? Quote Link to comment https://forums.phpfreaks.com/topic/157185-dropdown-displaying-text-that-passes-id-to-db/ Share on other sites More sharing options...
Ken2k7 Posted May 7, 2009 Share Posted May 7, 2009 Yeah. You would probably want it to look like this in the end: <option value='1234'>Miami</option> If City_ID is unique, then all you need is the number. Quote Link to comment https://forums.phpfreaks.com/topic/157185-dropdown-displaying-text-that-passes-id-to-db/#findComment-828263 Share on other sites More sharing options...
ThisIsMyName Posted May 9, 2009 Author Share Posted May 9, 2009 Yeah, you're right, it was easy enough. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/157185-dropdown-displaying-text-that-passes-id-to-db/#findComment-830321 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.