PHP PDO PostgreSQL UTF-8 설정

1 개요[ | ]

PHP PDO PostgreSQL UTF-8 설정
$driver = 'pgsql';
$host = 'localhost';
$port = '5432';
$dbname = 'mydb';
$user = 'testuser';
$passwd = 'P@ssw0rd';
$dsn = "$driver:host=$host;port=$port;dbname=$dbname";

$pdo = new PDO($dsn, $user, $passwd);
$pdo->exec("SET CLIENT_ENCODING TO 'utf8'");
// $pdo->exec("SET NAMES 'utf8'");

2 같이 보기[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}