PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hi, I'm using the following PHP code to retrieve and print text from a mysql database. I have created a Flash movie that retrieves the text generated by this PHP file and displays it. For some reason some of the characters visible in the PHP file are invisible in the Flash movie, such as the characters '+' and '€'. I have spoken to a Flash expert about this and he suggested encoding my PHP file as unicode (UTF-8) format as Flash prefers this. Do you know how I can do this?
This really has nothing to do with the encoding of your PHP file. We need to know a few things:
1. What version of MySQL are you using?
2. If you are using 4.1 , what encoding is your table set at?
At least you'll need to convert the data in the database to UTF-8 on loading (probably from ISO 8895-1), but ideally the data gets stored in the database as UTF-8 to begin with.
You may alter the table character-set to utf8 if you are using MySQL 4.1 or higher. Also, you may need to execute the following query to let your MySQL server know what character-set you want to use.