stevelowe1000 Posted June 21, 2011 Share Posted June 21, 2011 Hi, I am using MySQL 5.5.13 / PHP 5.3.6 / phpMyAdmin 3.4.2 / on Windows 2003 Server Standard. I have a strange issue here. It is to do with the Polish character - ó - (and probably others as well). When I enter the above character directly into MySQL using phpMyAdmin it goes in fine. When I use the php function mysql_Query(), I get the following error, "Incorrect string value: '\xF3 ...". I have tried using "mysql_query("SET NAMES 'utf8'")" and "mysql_query("SET CHARACTER SET 'utf8'")", but still it fails. I have tried changing the field collation in MySQL from UTF-8 to standard Latin and back. I have even tried using iconv() function but that give an illegal character error. The strange thing is that I have a similar setup on another server using MySQL 5.1.33 / PHP 5.2.9, and it works fine for all characters. Can any one advise please. Quote Link to comment https://forums.phpfreaks.com/topic/239987-polish-characters-mysql_query/ Share on other sites More sharing options...
The Little Guy Posted June 21, 2011 Share Posted June 21, 2011 I believe when you insert the character it must insert as utf8, then when you pull it back out it must come out in utf8. So, if you insert it as latin1, and then change it to utf8, it won't display correctly. What you would need to do is re-insert it as utf8, so you can pull it out in utf8. Quote Link to comment https://forums.phpfreaks.com/topic/239987-polish-characters-mysql_query/#findComment-1233040 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.