DDC-560: Fix DBAL PostConnect code example in docs #5069

doctrinebot opened this Issue Apr 30, 2010 · 2 comments

2 participants


Jira issue originally created by user mjh_ca:

Two small corrections to http://www.doctrine-project.org/documentation/manual/2_0/en/dbal:configuration:dbal-events#postconnect-event

  • There should be a semi-colon after new EventManager() instead of a comma ** The parameter to the MysqlSessionInit constructor should be UTF8 and not UTF-8*. The parameter with the dash causes a PDOException:
  SQLSTATE[42000]: Syntax error or access violation: 1115 Unknown character set: 'UTF'

Corrected code:


$evm = new EventManager();
$evm->addEventSubscriber(new MysqlSessionInit('UTF8'));

$conn = DriverManager::getConnection($connectionParams, null, $evm);

Comment created by @beberlei:



Issue was closed with resolution "Fixed"

@beberlei beberlei was assigned by doctrinebot Dec 6, 2015
@doctrinebot doctrinebot added this to the 2.0-BETA2 milestone Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
@doctrinebot doctrinebot added the Bug label Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment