note 96325 modified in pdo.construct by thiago
| From: | thiago@php.net | Date: | Mon, 22 Feb 2010 02:20:34 +0000 |
| Subject: | note 96325 modified in pdo.construct by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-166234@lists.php.net to get a copy of this message | ||
If you use the UTF-8 encoding, you have to use the fourth parameter :
<?php
$db = new PDO('mysql:host=myhost;dbname=mydb', 'login', 'password',
array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\''));
?>
--was--
If you use the UTF-8 encoding, you have to use the fourth parameter :
$db = new PDO('mysql:host=myhost;dbname=mydb', 'login', 'password',
array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\''));
http://php.net/manual/en/pdo.construct.php