Forum Moderators: open
I have a MySQL table that contains UTF-8 Characters.
Unfortunately, when I insert contents from my table into my web pages, non ASCII characters are being shown as boxes.
All my pages are properly encoded using the UTF-8 Chartype. If I paste these characters directly into my page, the characters show fine.
The MySQL table has a default Collation of utf8_unicode_ci, and the text cells also have the same collation.
In PhpMyAdmin, when viewing the tables, the characters show properly.
Right now, the only guess I have is that maybe my weak point is when I use PHP to grab the contents form my table and insert them into the page.
I use the following code:
$link=mysql_connect("x","x","x");
mysql_select_db("x");
$result=mysql_query("SELECT * FROM table_name WHERE x='$x'");
$row=mysql_fetch_array($result);
echo $row["article"];
Any ideas?
Thanks
I have declaired that line of code, and my .php is also saved as with the right type of encoding. (One even without a BOM [webmasterworld.com]).
I have tried the following line in the same php document:
echo "René Descartes"; and it works fine, which tells me PHP can handle non ASCII characters.