Problem displaying information from database with double apostrophes
I have a form which needs to accept the size of an item. The input should be done as: 12" x 15". I pass this info through a "cleaning" function and then insert it into the database. In the database, it's a VARCHAR(30) and I see the info there. But when I pull this field from the database and display it, it shows as only 12. Everything after the double apostrophe is blank.
My real confusion comes in when I type the exact same thing into other text fields and it's displayed perfectly fine.
Am I missing something obvious here?
If you look at the HTML of page after pulling the field from the database, you will see that all the info is in the value of that field. If your field's value is between single quotes (e.g value='...') then those quotes will interfere with the apostrophe in your text.
You might want to encode special characters by using the PHP function htmlspecialchars ($string)
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)