I'm new to Zend Framework and I'm learning how to create an application following the steps in the framework.zend webpages.
I have a problem with the global.php page.
my global.php is:
return array(
'db' => array(
'driver' => 'Pdo',
'dsn' => 'mysql:dbname=zf2tutorial;host=127.0.0.1;charset=utf8',
'driver_options' => array(
PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'UTF8'"
),
),
'service_manager' => array(
'factories' => array(
'Zend\Db\Adapter\Adapter'
=> 'Zend\Db\Adapter\AdapterServiceFactory',
),
),
);
I'd like to know what the instruction PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'UTF8'"
is for, because it gives me an error if I run the application on localhost:8080.
This is the error: Fatal error: Undefined class constant 'MYSQL_ATTR_INIT_COMMAND' in C:\DevBox\zfproject\config\autoload\global.php
Can I remove that line? And If I cannot remove it how can I fix the problem?
I'm on windows and everything works if I remove that line but I don't think it's the right solution.