I have a script that i’d like to save the value selected from a dropdown menu – one of the options is the following htmlentity
⅛ // will appear as 1/8
But when this is saved to the database it is saved as a question mark? Whats the best method to save htmlentities to the database?
You should never save htmlentities in the database. If you want to generate something from database that isn’t HTML what would you do?
You can save it exactly like you have it, for mysql save with
mysql_real_escape_string()and then decode it withhtmlentities($field, ENT_QUOTES).