I am migrating my site into php mysqli from php mysql_* methods.
I had following code that did the job:
mysql_query(\"SET NAMES \'utf8\' COLLA
It is not recommended to use mysqli query in order to set names but rather mysqli::set_charset
$mysqli = new mysqli("localhost", "root", "", "test"); $mysqli->set_charset("utf8");