0

What alternatives could I use when displaying quotes " from my SQL Server database? Something that works like *_real_escape_string?

E.g.

$row['details'] has a value of "This is my quoted sentence"

Simply ECHOing this gives:

�This is my quoted sentence�

And I want it to go like this:

"This is my quoted sentence"
Felix Pamittan
  • 31,544
  • 7
  • 41
  • 67
  • Are you sure that the string in question begins and ends with a double quote character (unicode U+0022) and not left and right double quotation marks (U+201C & U+201D, respectively)? – Ben Thul Sep 22 '15 at 03:41
  • Its a left and right double quotation. What actually is on that `details` column is a commendation, and it is from the client. It was quoted to indicate that those are the exact words the client mentioned. – Dexter Raymund De Guia Sep 22 '15 at 04:08
  • 1
    Then they're not actually double quotes, but smart quotes. And it's a charset issue. – mario Sep 22 '15 at 04:16

1 Answers1

0

Looks like your page's charset does not match the charset of the database.

You can change your page's charset in the header section, like so:

<head>
<meta charset="UTF-8">
</head> 

or you can change the MySQL charset in PHP.

Sylverdrag
  • 8,898
  • 5
  • 37
  • 54