I am running WAMP 3.0.6 with MySQL 5.7.14. EVERYTHING is using UFT-8 character set.
I have data in a field "1£1" (that is 1 (pound) 1).
I have checked on the server (my own) and the Hex value for the field is: 31 C2 A3 31. This is correct.
I run a Query locally and it returns the correct datam with C2 A3 as the pound sign.
I run a Query in PHP, and it only returns A3, the Hex being 31 A3 31. This causes the pound sign to be a black question mark.
If I run echo pack ("C*",194,163); within the PHP, I get the correct pound sign.
So to clarify: MySQL is holding the correct data. Query on the server returns the correct data. PHP via web page will echo the correct pound sign from hex. php.ini is set for UFT-8. MySQL Database is set for UFT-8. HTML is set for UFT-8. PHP is set for UFT-8. PHP query is NOT receiving the correct data.
Has anyone any ideas? I am all out.
I found the answer:
I needed to put $mysqli->set_charset("utf8"); at the start of the code, presumebly to tell the connection to also be in UTF-8 char set.
$mysqli being the string which holds the "new mysqli()" data.