How can i change the MySQL characters encoding to UTF8?

By default the encoding is latin1 but you could try to workaround your code.


To change the encoding in your queries, you have to add the following lines after the dbase connection line in your code:


mysql_query(mysql,"SET NAMES 'utf8'"); /* note the apostrophes: 'utf8' */
mysql_query(mysql,"SET CHARACTER SET utf8"); /* no apostrohes */


Please, for more information check the mysql manual (

  • 1 Users Found This Useful
Was this answer helpful?
Related Articles
Copyright © 2020 PlusPlusHosting.Net. All Rights Reserved. is an authorized reseller of goods and services provided by PlusPlusHosting.Net.