Special characters not showing on page

Hi all,

I'm writting a database driven website but I'm having a problem with the display.

For some reason characters like: "% - £ $ " etc are being replaced on the page with question marks and other stuff.

Anyone have any idea on how to fix this?  Right now what I'm having to do is to insert £ instead of £ , which is really not practical.

Hope someone can help.


Who is Participating?
ST3VOConnect With a Mentor Author Commented:
OK, I fixed it, never mind.

Just have to add this line before the query:

mysql_query("SET NAMES 'UTF8'");

ChimerazaConnect With a Mentor Commented:
yeah those are special characters... with printing $ you need to escape it by placing the \ before it (\$)

You can use the ASCII code for them:

Can you paste an example of exactly what is giving you that error and I'll correct it for you.
ST3VOAuthor Commented:
When I insert some text into the database I get lots of black diamonds with a ? on it.
For example if I type "It's" on the database field I will get "it?s (where the ? is the black diamond with the ? in the middle.

This is display on the page that is read from the database but in the database I didn't type the ? and it's not there, it's just displayed that way on the php page when echoing the field content.

I want to be able the write whatever and for it to display properly. Don't want to have to use ascii codes.

Hope this helps

Glad you sorted it!
ST3VOAuthor Commented:
Thanks :o)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.