UTF-8 encoding issue with mysql flash and php

I am programming an online game using Flash. I am connecting my flash8 movie to a MySQL database through PHP. I am doing very well in this, and everything works fine for me.

Problems arise when I try to insert (using INSERT SQL func) data into a database that is not English. In other words, UTF-8 data.

I talked a lot about this eloquently, and found and applied the following: 1. In PHP4 you need to tell PHP to use UTF-8 when using the xml_parser_crater () function, however in PHP5 this is done automatically. Although I told PHP5 to use UTF-8 when calling a function.

  • Adding a header to XML sent by PHP from a flash drive.

  • Make FLASH use UTF-8 encoding in preference settings.

  • Set the encoding in MySQL to UTF-8 (utf8_unicode_ci with the InnoDB engine). I can read and paste the data of another language correctly in phpadmin.

I did all this in my coding, and yet I cannot insert such data.

Another strange thing: when I use the same link, FLASH, using the XML that creates the FLASH in the browser (google chrome), I got the data inserted directly into the database !!!!!

I'm going to go crazy about this, what am I missing? What causes the problem?

+3
source share
3 answers

I think you need to turn off the functions mysql_*and switch to something better, for example, mysqli_*or PDO. See http://maurus.net/weblog/2006/07/28/typo3-php-mysql-connections-and-unicode/

+1
source

mysql_connect/mysql_select_db :

mysql_query('set character set utf8');

PHP-MySQL UTF-8

0

Source: https://habr.com/ru/post/1784344/


All Articles