문제

I'm currently working on a php sql based translation database and am having issues getting the 6 distinct Turkish characters into sql.

the page is set to a utf charset and I have tried using utf8_encode to no effect, I am also using Cyrillic on the page so am stuck having it all in utf8.

at the moment I am just trying to pass the value from a form via post and then echoing it out, but that is also failing.

any help would be greatly appreciated.

edit*

managed to get it to output in an echo with htmlentities, unfortunately it is now not entering sql properly. the field is set to utf8_unicode_ci

update code is below

mysql_query("SET NAMES UTF8");
mysql_query("UPDATE turkish='$turkish'  WHERE tid='$tid'");
도움이 되었습니까?

해결책

When doing updates do it this way:

mysql_query( "UPDATE turkish = _utf8'$turkish'  WHERE tid='$tid'" );

don't use utf8_encode or anything similar just make sure $turkish contains valid utf-8 data.

and when reading:

SELECT tid, BINARY turkish, ...
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top