note 90444 modified in ref.pdo-mysql by danbrown

From: Date: Wed, 22 Apr 2009 21:11:59 +0000
Subject: note 90444 modified in ref.pdo-mysql by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-153592@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 : <?php $pdo = new PDO( 'mysql:host=hostname;dbname=defaultDbName', 'username', 'password', array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8") ); ?> --was-- 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") ); http://php.net/manual/en/ref.pdo-mysql.php

« previous php.notes (#153592) next »