jcbarr Posted September 26, 2008 Share Posted September 26, 2008 I'm pulling data from a MySQL database that is formatted as text in the database but when I display it after calling from the query, apostrophes don't display correctly. They show up as a question mark enclosed in a diamond like shape. I believe the exclamation points do the same thing. I tried changing the format of the text to utf8_bin from Latin, but it still shows up that way. Am I missing something easy here? Quote Link to comment Share on other sites More sharing options...
jcbarr Posted September 27, 2008 Author Share Posted September 27, 2008 Here is the code that is being used to display it as well. <? if (isset($pid) && !isset($event)){ $sql="SELECT * FROM roleplays WHERE id='$pid'"; $a=mysql_query($sql, $link); $b=mysql_fetch_array($a); extract($b); echo "<img src='../images/body/$user.jpg' align=right hspace=5 vspace=5>"; echo "<b><h2>$title</h2></b><P>"; echo nl2br($content); echo "<P><center><a href='../promos.php'>Back To Promos</a></center>"; } ?> Quote Link to comment Share on other sites More sharing options...
jcbarr Posted September 27, 2008 Author Share Posted September 27, 2008 No ideas on this? Thanks, I promise I won't bump it anymore Quote Link to comment Share on other sites More sharing options...
DamienRoche Posted September 27, 2008 Share Posted September 27, 2008 From what I remember it isn't your code or the database settings...it's what you are using to view the output. Try using a defining different encodings. example: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> Here's a helpful tutorial: http://www.w3.org/TR/REC-html40/charset.html Hope that helps. Quote Link to comment Share on other sites More sharing options...
jcbarr Posted September 27, 2008 Author Share Posted September 27, 2008 This was another instance of me being dumb. It was a simple copy and paste error. When you paste them in to the form they come out funky, but if you type them they are fine. I'm gonna mark this as solved, but if anyone does know why that would happen I would be interested. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.