Skip to content

Commit 8184401

Browse files
author
Robert-Jan de Dreu
committed
Ref #4668 and #4688: Added more info in docs on how to set the charset for PDO
1 parent b93a4cf commit 8184401

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

guide/database/config.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,21 @@ CONNECTION_ARRAY
2525
TABLE_PREFIX
2626
: Prefix that will be added to all table names by the [query builder](#query_building).
2727

28+
CHARACTER_SET
29+
: The character set to use for the connection with the database.
30+
31+
[!!] Setting Character Set won't work for PDO based connections because of incompatibility with PHP prior to 5.3.6. Use the DSN or options config instead. Example Below:
32+
33+
return array
34+
(
35+
'default' => array
36+
(
37+
'type' => 'PDO',
38+
'connection' => array(
39+
'options' => array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"),
40+
),
41+
),
42+
);
2843

2944
## Example
3045

0 commit comments

Comments
 (0)