SQLSTATE[08006] [7] invalid connection option "charset" |
Hello
I'm trying to connect with PDO to my database. Here is the error message : A Database Error Occurred SQLSTATE[08006] [7] invalid connection option "charset" Filename: controllers/HomeController.php Line Number: 10 The HomeController : PHP Code: <?php And the data base : PHP Code: $active_group = 'default'; It worked with mysql but I'd like to be able to use PDO. Any help ? Thank you, Martin.
Read the first NOTE here in the CodeIgniter Users Guide:
Connecting to your Database What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
EDIT : Found the solution :
$db['default'] = array( 'dsn' => 'mysql:host=localhost; dbname=xxx', 'hostname' => '', 'username' => 'root', 'password' => 'root', 'database' => '', 'dbdriver' => 'pdo', 'dbprefix' => '', 'pconnect' => FALSE, 'db_debug' => (ENVIRONMENT !== 'production'), 'cache_on' => FALSE, 'cachedir' => '', 'char_set' => 'utf8', 'dbcollat' => 'utf8_general_ci', 'swap_pre' => '', 'encrypt' => FALSE, 'compress' => FALSE, 'stricton' => FALSE, 'failover' => array(), 'save_queries' => TRUE );[/php] |
Welcome Guest, Not a member yet? Register Sign In |