Knowledge base
1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Resolve a character set issue when connecting to the database
MySQL server settings force the use of UTF-8 by default.
If you need to set the storage to Latin, for example, add the following lines in the PHP section of your query:
mysql_query("SET CHARACTER SET latin1");
For older hosting plans, force MySQL connection to latin1 via the .htaccess file located at the root of your hosting:
php_value mysql.connect_charset latin1
php_value mysqli.connect_charset latin1
php_value pdo_mysql.connect_charset latin1
For current offers, place the following code in a .user.ini file located at the root of your hosting:
mysql.connect_charset = "latin1"
mysqli.connect_charset = "latin1"
pdo_mysql.connect_charset = "latin1"
Link to this FAQ: