I do:
$conn->real_connect($host,$user,$pass,$someUTF8Schema);
Then I print what I get from:
$conn->get_charset()
It is:
charset = "latin1" collation = "latin1_swedish_ci"
Even though my schema and all tables in the DB are utf8.
To prove it, I do:
SELECT DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME
FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = $someUTF8Schema;
->
# DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME
'utf8', 'utf8_unicode_ci'
Why is PHP MySQLi returning the wrong collation? Thanks!