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? Link to comment https://forums.phpfreaks.com/topic/126008-solved-apostrophes-dont-display-correctly/ 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>"; } ?> Link to comment https://forums.phpfreaks.com/topic/126008-solved-apostrophes-dont-display-correctly/#findComment-651656 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 Link to comment https://forums.phpfreaks.com/topic/126008-solved-apostrophes-dont-display-correctly/#findComment-651827 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. Link to comment https://forums.phpfreaks.com/topic/126008-solved-apostrophes-dont-display-correctly/#findComment-651828 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. Link to comment https://forums.phpfreaks.com/topic/126008-solved-apostrophes-dont-display-correctly/#findComment-651848 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.