|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
PHP5/MySQL/UTF8
Hello,
I'm trying to get PHP 5.0.1 and MySQL 4.1.4gamma working together to display UTF-8 encoded text. Using ColdFusion, this worked without any problems, however I can't seem to get PHP to output the text correctly. Here is my current code: PHP Code:
I think my database is set up correctly, so I think I'm goofing something up in my PHP. Any suggestions? Oh, and yes, my code probably isn't the best but I haven't touched PHP in quite a while.
__________________
blockcipher --------------- Gratuitously stolen... mysql> SELECT * FROM user WHERE clue > 0; 0 Results Returned. PHP5/MySQL/UTF-8 My Tech Blog Last edited by blockcipher : April 15th, 2005 at 10:19 AM. |
|
#2
|
|||
|
|||
|
O.K. I think I'm a bit further in my debugging. It turns out that the client character set is latin1_swedish_ci. Does anyone know how to change that for mysqli?
|
|
#3
|
|||
|
|||
|
Nevermind, I found it. You have to use the mysql_options command to point the mysql client to a valid my.cnf or my.ini file.
Here's my example code: PHP Code:
|
|
#4
|
|||
|
|||
|
I'm also trying but no luck at all
your topic wrote php,mysql,/utf-8 but is mysqli mysql? I'm using mysql, apache , php also trying to get it works and that should be someway for it to work without changing more setting in .ini, .conf and so on because it can be view perfectly in latest phpmyadmin and not a normal website with header as utf-8 i tried looking into alot forums and alot web result this question/ problem didn't have a answer or i just have rotten luck. |
|
#5
|
|||
|
|||
|
Sorry for the late response, but I don't frequent the PHP forums very often.
mysqli is the new mysql extension for PHP 5. It supports unicode, the new authentication protocol, prepared statements, and other features. I don't know how phpMyAdmin managed to make stuff work without doing what I stated. Sorry. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > PHP Development > PHP5/MySQL/UTF8 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|