Take the 2-minute tour ×

I run a fantasy football management game and I'm in the process of adding multiple nationalities.

How can I set up PHP / MySQL to accept foreign characters (ALL TYPES). At the moment I'm trying to add Arabic but I'm not having much luck. Which encoding do I need to use and how do I make it work?

I've set both to UTF-8 unicode Please see here: http://www.footielegend.com/test/header.php

It stores it fine in the database.

share|improve this question
Using UTF-8 all the way through - on the page, in the data base, in the database connection - is the required first step. Are you doing that? (The second step for Arabic is dealing with Right-To-Left script, which I don't have much experience with, but all the necessary information should be available on Stack Overflow already.) –  Pekka 웃 Nov 22 '11 at 23:41
add comment

2 Answers

up vote 1 down vote accepted

Figured it, I just needed to add this after I connect to the database:

share|improve this answer
Maybe this assist you: stackoverflow.com/questions/845418/hsqldb-table-encoding/… stackoverflow.com/questions/7501924/… But as Pekka I't know much about Arabic, Chinese and Russian characters. –  Diblo Dk Dec 28 '11 at 14:19
add comment

Use UTF-8. Make sure your database collation is set to that (db, tables, and columns) and your php script also.

share|improve this answer
all are set to UTF-8 unicode –  FootieLegend Nov 23 '11 at 0:21
@FootieLegend, what seems to be the problem then? You say it's storing fine in the database. Is it not displaying back properly? –  Alexey Gerasimov Nov 23 '11 at 1:30
add comment

Your Answer


