note 59149 added to function.mysql-client-encoding
| From: | vrbcik at osu1 dot php dot net | Date: | Sun, 27 Nov 2005 17:26:29 +0000 |
| Subject: | note 59149 added to function.mysql-client-encoding | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-99201@lists.php.net to get a copy of this message | ||
I have had problems with encoding after export of tables (from hosting - via PhpMyAdmin) and import
them to other machine (my notebook - via PhpMyAdmin too). In PhpMyAdmin the encoding of all data was
shown correctly, not that good with the web pages (data pulled via php).
The first point is indication, that the data was imported correctly, but php script has got other
character set than MySql is sending.
The script's character set is set in header: <meta http-equiv="Content-Type"
content="text/html; charset=ISO-8859-2">. MySql setting was latin1.
Then following code helped me:
<?php
mysql_query("SET CHARACTER SET 'latin2'", $conn);
?>
----
Manual Page -- http://www.php.net/manual/en/function.mysql-client-encoding.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+59149
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+59149&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+59149&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+59149&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+59149&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+59149&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+59149&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+59149&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+59149&report=yes
Search -- http://master.php.net/manage/user-notes.php