Skip to content

Loading…

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

Closed
doctrinebot opened this Issue · 2 comments

2 participants

@doctrinebot

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:

<?php

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

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

Comment created by @beberlei:

Fixed

@doctrinebot

Issue was closed with resolution "Fixed"

@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot added this to the 2.0-BETA2 milestone
@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.