The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. February 12, 2012, 04:51:46 PM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: Displaying apostrophe from mysql?  (Read 385 times)
leaferz
Rookie
**
Offline Offline

Posts: 19


View Profile
« on: February 10, 2010, 01:00:18 PM »

I manually entered in a sentence in mysql using phpmyadmin but once I attempt to output it the browser replaces it with a blue boxed question mark. I tried using htmlspecialchars, htmlentities, html_entity_decode with ENT_QUOTES but still nothing.

Has anyone else ever seen anything like this?
Logged

No links in signatures please
nutballs
Administrator
Lifer
*****
Offline Offline

Posts: 5604


Back in my day we had 9 planets


View Profile
« Reply #1 on: February 10, 2010, 06:26:54 PM »

thats a character encoding issue.

You are ending up with "smart quotes" which are the kind that point in the right direction instead of just the straight quotes that you actually need.

If you are pasting the text from something like Word, thats what's causing it. Paste into notepad first, then into mysql. Thats the quick and dirty fix.

Otherwise, make sure your server is sending the right character encoding type. (utf8, ansi-blah, whatever).
Logged

I could eat a bowl of Alphabet Soup and shit a better argument than that.
leaferz
Rookie
**
Offline Offline

Posts: 19


View Profile
« Reply #2 on: February 10, 2010, 10:24:16 PM »

thats a character encoding issue.

You are ending up with "smart quotes" which are the kind that point in the right direction instead of just the straight quotes that you actually need.

If you are pasting the text from something like Word, thats what's causing it. Paste into notepad first, then into mysql. Thats the quick and dirty fix.

Otherwise, make sure your server is sending the right character encoding type. (utf8, ansi-blah, whatever).

Perfect, I'll look into all of them to see which one fits.

EDIT: Just rewrote the sentence in the DB manually and now it displays properly. This was one of the few I did copy and paste from a web page. 

Thx.
« Last Edit: February 10, 2010, 10:28:18 PM by leaferz » Logged

No links in signatures please
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!