I have a database with a field named "title". Collation is set to utf8_general_ci. I have a php file with an insert into it. The php file will $_GET the value to insert. The title is in UTF-8, ie. Képzelj el engem nélküled. For some resason in mysql I have inseted the value as Freevlog - Képzelj el engem nélküled. I don`t know what to do... My "title" table is utf8_general_ci, the database itself is UTF to. The result is not UTF... I have also added into the php mysql insert script this: print "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\" />"; Code (markup): What am I missing?
Do you connect to database properly? You should use: SET NAMES 'utf8' Code (markup): just after connecting to database
Do you declare UTF in your header of the form used to GET the data? <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> Code (markup): Also, see utf_encode $title = utf_encode($title); Code (markup):
I have managed to fix this by adding this after the sql connect: mysql_query("SET CHARACTER SET utf8"); mysql_query("SET SESSION collation_connection =`utf8_general_ci`") or die (mysql_error()); Code (markup):