Home php Why did the encoding in SQL, and how to fix everything?

Why did the encoding in SQL, and how to fix everything?

Author

Date

Category

There is a local project on OpenServer, the database in the utf8_general_ci encoding with three fields and the output script all this page:

& lt;? php
 $ Connect = mysqli_connect ("127.0.0.1", "root", "", "organiser");
 mysqli_query ($ Connect, "Set Names 'utf8'");
 MySQLI_Query ($ Connect, "Set Character Set 'UTF8';");
 mysqli_query ($ Connect, "SET SESSION COLLATION_CONNECTION = 'UTF8';");
 $ Query = "Select * from` notes` ";
 $ notes_result = mysqli_fetch_assoc (Mysqli_Query ($ Connect, $ Query));
? & gt;

When displaying text on the page there is such a beauty:

Open Server config:

  1. apache 2.4
  2. php 5.5
  3. mysql 5.6

tried to change the comparison of the table columns – zero effect.
Adding to the header code ('CONTENT-TYPE: TEXT / HTML; CHARSET = UTF8', TRUE); I did not give the result.


Answer 1

Reset Open Server Setup and fill in all values
Must work

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions