note 89593 added to ref.pdo-mysql.connection
| From: | rustamabd at gmail dot com | Date: | Sun, 15 Mar 2009 20:18:26 +0000 |
| Subject: | note 89593 added to ref.pdo-mysql.connection | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-151976@lists.php.net to get a copy of this message | ||
Even though pdo_mysql accepts an additional "charset" parameter in the DSN (see
mysql_driver.c:442), as of PHP 5.2.9 it does not do anything with it.
A possible workaround to set the charset to UTF-8, for example, could be:
<?php
$dbh = new PDO("mysql:$connstr", $user, $password);
$dbh -> exec("set names utf8");
?>
----
Server IP: 83.137.20.135
Probable Submitter: 82.139.118.133
----
Manual Page -- http://www.php.net/manual/en/ref.pdo-mysql.connection.php
Edit -- https://master.php.net/note/edit/89593
Del: integrated -- https://master.php.net/note/delete/89593/integrated
Del: useless -- https://master.php.net/note/delete/89593/useless
Del: bad code -- https://master.php.net/note/delete/89593/bad+code
Del: spam -- https://master.php.net/note/delete/89593/spam
Del: non-english -- https://master.php.net/note/delete/89593/non-english
Del: in docs -- https://master.php.net/note/delete/89593/in+docs
Del: other reasons-- https://master.php.net/note/delete/89593
Reject -- https://master.php.net/note/reject/89593
Search -- https://master.php.net/manage/user-notes.php