0

My php Web application not supporting Arabic language. I want to add data from a form and display the table in browser. When I type Arabic letters it store some other characters(أخبار أخباØ) and display as ????? in browser.

But the same application support Arabic in my local server localhost. How to solve this please help.

  • Does this answer your question? [Save Data in Arabic in MySQL database](https://stackoverflow.com/questions/6859018/save-data-in-arabic-in-mysql-database) – William Baker Morrison Dec 27 '20 at 10:04
  • "Support Arabic" is a very broad concept. But using UTF-8 should be the basic foundation. You're possibly relying on defaults rather that setting encoding explicitly. – Álvaro González Dec 27 '20 at 15:03
  • I add this code -----> $conn = mysqli_connect("localhost", "user", "password", "db"); mysqli_set_charset($conn, 'utf8mb4'); -------------- with connection and this worked :) . – Rahana Razak Dec 28 '20 at 07:23

1 Answers1

1

To store any kind language in database you need to set collation utf8_unicode_ci

utf8_unicode_ci should support almost all language

Follow the steps:

  1. Go to phpMyadmin
  2. Select table's column that is storing data
  3. edit collation to utf8_unicode_ci

That's all it should work.

SK Shewa
  • 106
  • 1
  • 9