Page 1 of 1

Mysql Insert query charset problem

Posted: Fri Oct 09, 2009 2:12 am
by poohinq
Hello,

I have my SQL server character set Set to UTF-8,
my database character-set set to UTF-8 and
t_statustype table character-set set to UTF-8

I am trying to exequte the following query:

mysql_query ("Insert into t_statustype (f_statustype_name) VALUES ('Предпроектно проучване') ")

After the execution i have "Ïðåäïðîåêòíî ïðîó÷âàíå" value in my db

if i set
mysql_query("SET NAMES 'utf8'");
mysql_query("SET CHARACTER SET 'utf8'");

before execution of the query i receive th following error :
" Incorrect string value: '\xCF\xF0\xE5\xE4\xEF\xF0...' for column 'f_statustype_name' at row 1"

If i execute the query from SQL editor it works fine!

Any ideas what might be the problem?
Thank you!

Re: Mysql Insert query charset problem

Posted: Fri Oct 09, 2009 2:46 am
by wonder
please debug and get the exact value before executing mysql_query() function;

If it is correct, try to check the language package you use.

good luck

Re: Mysql Insert query charset problem

Posted: Fri Oct 09, 2009 3:24 am
by Griven