php+mysql problem with unicode utf-8

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
hellraiser3gr
Forum Newbie
Posts: 3
Joined: Tue Jun 09, 2009 9:59 am

php+mysql problem with unicode utf-8

Post by hellraiser3gr »

hello! this is a great community. I would like to post my problem.

I am using PHP and MySql. I have created a database using unicode utf-8 ci and a table in it. I use PHP code ( I am using notepad and save as UTF-8) in order to access the contents of my database and diplay them on my page. The problem is that the greek words do not appear correcty. (They appear as question marks (?)). I have tried some solutions that I have found on the web but none of them worked for me. Can u suggest me any solutions? thanks a lot.
User avatar
mikemike
Forum Contributor
Posts: 355
Joined: Sun May 24, 2009 5:37 pm
Location: Chester, UK

Re: php+mysql problem with unicode utf-8

Post by mikemike »

What it your HTML page encoding?

This may be useful:
http://en.wikipedia.org/wiki/Character_ ... gs_in_HTML
hellraiser3gr
Forum Newbie
Posts: 3
Joined: Tue Jun 09, 2009 9:59 am

Re: php+mysql problem with unicode utf-8

Post by hellraiser3gr »

thanks for the answer! I found a solution. I have just added this line to my code

mysql_query(”set names utf8″);
Post Reply