1

I'm sending a XMLHttpRequest from a js file to a php file. The php file gets results from a MySql Database stored on a Ubuntu Remote Server. In the Database, I have stored a movie title 7 Años. The php code keeps echo ing 7 A�os. How to fix this issue? Where is this issue happening exactly?

I have included the lines header("Content-Type: UTF-8"); and mysqli_set_charset($connection, "UTF8"); in the beginning of the php file.

The Column Collation:

enter image description here

aman
  • 801
  • 15
  • 34
  • What's your DB encoding? – Tarasovych Jul 26 '19 at 05:42
  • @Tarasovych updated the question. – aman Jul 26 '19 at 05:45
  • Have a look at the flagged dupe for details about why this happens and how you can solve it. I have previously written a little "[checklist](https://stackoverflow.com/a/31899827/4535200)" for using UTF8 in MySQL/PHP applications, which can be handy. – Qirel Jul 26 '19 at 05:48
  • Yeah going through that file – aman Jul 26 '19 at 05:48
  • Sorry your question has already exist , Best luck – hs-dev2 MR Jul 26 '19 at 05:50
  • @hs-dev2MR I have seen through those questions and implemented their solutions but nothing helps. – aman Jul 26 '19 at 05:51
  • The data in the database won't magically be fixed if it is broken. Implement all the steps (from my checklist its easy to see which ones you need - and you need all of the relevant ones, don't skip any of them), then re-insert the data. – Qirel Jul 26 '19 at 05:56
  • First try as @Qirel said , the important thing is don't ignore even a tiny tip . Sometimes a tiny miss cause headache :> – hs-dev2 MR Jul 26 '19 at 05:59

0 Answers0