PHP only displaying ID and not the value from mysql -
I have a selection menu with values below 'apartment_type' in a mysql database when I This is the initial form: thanks As told, not $ _POST Instead of including values derived from the database, rather, this data that is posted on the script (from your form) I think is going to generate> a Normally, you will edit the ID again and later to get that advertisment type display value, and whatever you are looking for will be better. If you were building a multi-language site, you might need to join a separate table to get the display value based on the language given in question, so it does not mean to cache string value Will happen. If you really want to get the string value of the type of apartment type to be posted on your form handling code, you can PS: There is only one "P" in the apartment :) & lt ;; Php echo $ _POST ['apartment_type']; ? & Gt; This only shows ID numbers How can I echo the type of apartment instead?
& lt; Div class = "form-group" & gt; & Lt; Select class = "form-control" id = "apartment_type" name = "apartment_type" & gt; & Lt ;? Php echo $ bsiCore- & gt; GetApmtTypeCombobox () ;? & Gt; & Lt; / Select & gt; & Lt; / Div & gt;
& lt ;? Php echo $ bsicore-> GetApmtTypeCombobox () ;? & Gt; Too many
& lt; Option value = "id" & gt; Apartment type 1 & lt; / Option & gt; s
& lt; Select & gt; Input, like you've found, selected
& lt; Options & gt; For example, IDs will be posted to the
value attribute of .
& lt ;? Php echo $ bsicore-> GetApmtTypeCombobox () will need to adjust the output) ;; & Gt; To use the value of the option that you want to post in the value attributes of the option (like
& lt; option value = "apartment type 1" & gt; apartment type 1 & lt; / option & Gt; )
Comments
Post a Comment