PHP MySQL Greek letters showing like ???? marks

后端 未结 6 612
广开言路
广开言路 2020-11-29 08:37

I have a table with some text and text is greek letters, when i use sql tool and select the data from this table is showing correctly

6条回答
  •  时光说笑
    2020-11-29 09:07

    I wasted many hours till i figured this out.

    Intro: Greek characters were appearing wrong in mysql. I applied qxxx answer in PHP and worked fine. Then I had to migrate everything to a new host, and then the problem reappeared.

    What was wrong?

    The MySQL's schema charset was set to latin. The stored procedures had inherited MySQL's schema charset for their parameters.

    So what I did:

    1. Dropped MySQL procedures/functions (make sure you backup your code)

    2. Changed default charset of MySQL (using MySQL Workbench, right click on your database name-has a db icon..)

    3. re-created the MySQL procedures/functions

    Also, I left intact the qxxx 's fix!

提交回复
热议问题