Etay Liberman
Etay Liberman

Reputation: 175

Getting question marks instead of Hebrew while using PHP+MySQL

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!

Upvotes: 2

Views: 1281

Answers (1)

Etay Liberman
Etay Liberman

Reputation: 175

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!

Upvotes: 5

Related Questions