Do you have PHPMyAdmin? if you do it is easy to do this...
Simply got and edit any field (the actual properties of the field, like varchar, auto_increment, etc...) and change the "Collation" field to "utf8_unicode_ci". You will see that the default is on "latin1_swedish_ci".
After that, simply query your database with the query "SET NAMES utf8" before your normal query to the database, so something like this as an example:
mysql_query("SET NAMES utf8");
// then your query afterwards...
And you should be alright. To get/retrieve from the database also do the SET NAMES query beforehand.
Hope this helps!
Main Topics
Browse All Topics





by: str_kaniPosted on 2007-10-31 at 11:27:46ID: 20187909
see this for preparing sql statements for loading unicode values
http://www.shawnolson.net/