Mysql – Accent marks/symbols not displaying correctly in MySQL database

MySQLmysql-5.7unicodeutf-8

Anytime there's an accent mark (é or ') or symbol (&) in my database it displays as HTML code. The table CHARACTER SET is UTF-8 Unicode and the COLLATION is utf8mb4_general_ci, which should display those characters correctly. Any ideas why this is happening?

(MySQL version 5.7)

Current data

`company`| `firstname`| `lastname`
----------------------------------
A&T  | Patrick    | O'Brien

Expected

`company`| `firstname`| `lastname`
----------------------------------
A&T      | Patrick    | O'Brien

Thank you in advance!

Best Answer

Fix the data source to store actual characters into MySQL, not "HTML entities".

Where necessary, use output routines such as PHP's html_entities() and/or urlencode()