Store and query Arabic characters in mysql using PHP

I want to create a table in mysql db which will be populated and quieried using PHP form or HTML, this table will have 2 columns one is English, and the other is Arabic, can someone tell me how to do so please?
Ashraf-HassanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bernard S.CTOCommented:
You have several problems to solve.

0 - I strongly recommand that you print http://www.sitepoint.com/blogs/2004/05/18/understanding-unicode/ and keep the copy handy.

1 - Select UTF8 as your character code. This implies that all your html and php files are encoded using utf8 with no BOM.
Be sure that your php scripts output html code with an explicit mention to utf8

2 - Check that this works fine with non-arabic characters, including accented latin characters such as é à etc

You will then know for sure that all of this is OK for latin chars, and that you have no problem with utf8 etc

3 - Using phpmyadmin, select arabic display. Then input arabic text into one field of the database
check that the display back is fine

You will then know for sure that you can enter and display back arabic chars

4 - Create a simple php script (in utf8 of course) that will read the table and display both the latin and arabic field. You will probably need to do some CSS to format the text as rtl for arabic and ltr for latin.


The item list I suggest will have only one problem at a time, so that you can solve it one after the other. More importantly, keep your php script to debug any problem you might find later.

Nothing really difficult, it is just that there are many layers of parameters that make this complex.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ashraf-HassanAuthor Commented:
Thank you I have managed to create a mysql table with utf8
0
Bernard S.CTOCommented:
B-) Glad to know it is now solved. Thx for the grade and points.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.