0

Symbols like "é" show interrogation marks in my php site.

My MySQL database uses utf8mb4_general_ci everywhere

The HTML is UTF-8 : meta charset is set to UTF-8

The response header is : Content-Type: text/html; charset=UTF-8

My SQL requests (in the PHP) that feature an "é" symbole result in a broken answer, but the same requests via phpMyAdmin (directly on the server) are working.

Also, for some reason, one "é" symbol works on my site, all the rest of them are interrogation marks (and they're all in a datatable generated by the same php code)

Would the problem perhaps be with the apache server ?

Tim
  • 394
  • 2
  • 14
  • See "question mark" in https://stackoverflow.com/questions/38363566/trouble-with-utf8-characters-what-i-see-is-not-what-i-stored – Rick James Nov 15 '19 at 04:59

1 Answers1

1

Try running the following query before you fetch the data.

SET NAMES 'utf8mb4'

  • What I did is set the DSN to charset=utf8 which works pretty much the same I believe. Any insight on why this is necessary ? Thanks ! – Tim Nov 15 '19 at 08:17