Web Hosting Talk







View Full Version : Quotes does not display correctly


tarsius
06-03-2006, 10:41 AM
Hi,

I have texts stored in MySQL. When I extract and display them, there are no problems with the standard characters except with the double quotes and single quotes (" and ') have problems displaying. They display like this “ or like this ’. The MySQL's data type I use is text. I'm sure it's nothing to do with the data type. I heard about charsets but I'm not familiar with them.

Please help. thanks.

Mambug
06-03-2006, 12:55 PM
There are reserved symbols you cannot use in strings. I'd suggest not using and storing " or ' within your databases.

Elliot A
06-04-2006, 12:51 AM
Try using htmlspecialchars on the text you want to store to convert the quotes to the HTML equivalents.

http://www.php.net/htmlspecialchars

dmspilot
06-04-2006, 06:44 PM
There are reserved symbols you cannot use in strings. I'd suggest not using and storing " or ' within your databases.

You certainly can store those characters in a database without problem. Sounds like the problem is with PHP, not MySQL.

dmspilot
06-04-2006, 06:45 PM
Sorry, duplicate.

thartdyke
06-04-2006, 08:09 PM
What is the source of your data? Are those quotes avrually curly quotes? You will need to convert these in some way before putting them in the database

white_tiger
06-14-2006, 03:32 AM
it because the difference between " - made by notepad and " - made by text editor such as microsoft word...
to avoid " - made by ms.word, usually i copy the entire text to notepad, then insert it to the DB..