Welcome Guest, Not a member yet? Register   Sign In
SQLSTATE[08006] [7] invalid connection option "charset"
#1

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
defined
('BASEPATH') OR exit('No direct script access allowed');

class 
HomeController extends CI_Controller {

 
 

    public 
function __construct()
 
   {
 
       parent::__construct(); 

And the data base : 

PHP Code:
$active_group 'default';
$query_builder TRUE;

$db['default'] = array(
    
'dsn'    => 'pgsql:host=localhost; dbname=xxx; charset=utf8;',
    
'hostname' => 'localhost',
    
'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
); 

It worked with mysql but I'd like to be able to use PDO. 

Any help ? 

Thank you, 
Martin. 
Reply


Messages In This Thread
SQLSTATE[08006] [7] invalid connection option "charset" - by martin88 - 11-13-2016, 03:24 PM



Theme © iAndrew 2016 - Forum software by © MyBB