PHP/MySQL and UTF-8
Posted on 2006-04-28
I'm using PEAR's DB (using mysqli) class to read/write to the database in my PHP application. I have the MySQL database tables using the utf8_general_ci collation. After I create the connection to the database, I send the query: "SET NAMES utf8" to ensure that MySQL knows it's getting UTF-8 character data. The question I have, is do I need to run all data to be inserted into the database through PHP's utf8_encode() function first? And if that's the case, is there a way to automate that so I don't forget?