note 90445 added to pdo.connections
| From: | DavyDefaud at osu1 dot php dot net | Date: | Wed, 22 Apr 2009 19:34:42 +0000 |
| Subject: | note 90445 added to pdo.connections | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-153590@lists.php.net to get a copy of this message | ||
This is the way to force mysql PDO driver to use UTF-8 for the connection :
$pdo = new PDO(
'mysql:host=hostname;dbname=defaultDbName',
'username',
'password',
array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")
);
----
Server IP: 195.221.21.36
Probable Submitter: 82.238.203.157
----
Manual Page -- http://www.php.net/manual/en/pdo.connections.php
Edit -- https://master.php.net/note/edit/90445
Del: integrated -- https://master.php.net/note/delete/90445/integrated
Del: useless -- https://master.php.net/note/delete/90445/useless
Del: bad code -- https://master.php.net/note/delete/90445/bad+code
Del: spam -- https://master.php.net/note/delete/90445/spam
Del: non-english -- https://master.php.net/note/delete/90445/non-english
Del: in docs -- https://master.php.net/note/delete/90445/in+docs
Del: other reasons-- https://master.php.net/note/delete/90445
Reject -- https://master.php.net/note/reject/90445
Search -- https://master.php.net/manage/user-notes.php