2

I'm connecting to MySQL with PHP, fetching Hebrew results, and getting question marks instead of Herbew letters.

I know it may be duplicated, but I did whatever needed from anywhere in the internet (including here) but I got nothing.

  1. The relevant columns is with CHARSET utf8 COLLATE utf8_general_ci.
  2. I did add the relevant Headers on top of the PHP code:

    HEADERS (header('Content-Type: text/html; charset=utf-8'); )

  3. I did add the Meta tags under the "Head" tag:

  4. I did add the relevant SET-NAMES call before connecting:

    mysqli_query("SET NAMES utf8");

If it helps, when querying the database using Workbench /J, I do get Hebrew results. However, on PHP...still...getting question marks.

Any idea what can I do?

Thanks!

Etay Liberman
  • 175
  • 1
  • 11
  • possible duplicate of [SET NAMES utf8 in MySQL?](http://stackoverflow.com/questions/2159434/set-names-utf8-in-mysql) –  Nov 29 '14 at 22:22
  • possible duplicate of [PHP MySQL utf 8 encoding](http://stackoverflow.com/questions/7610254/php-mysql-utf-8-encoding) – Strawberry Nov 29 '14 at 22:46

1 Answers1

5

Ho...just found a question in anoher post about general Encoding: PHP MySQL utf 8 encoding.

Just need to add: $connect->set_charset("utf8");

I'm not deleting this question since it may help some guys in the future.

Thanks!

Community
  • 1
  • 1
Etay Liberman
  • 175
  • 1
  • 11
  • Thank you!, This is how it looks and now working: $conn = new mysqli($servername, $username, $password, $dbname); $conn->set_charset("utf8"); – Saraf Aug 23 '22 at 08:38