Welcome Guest, Not a member yet? Register   Sign In
Using PDO for database connection
#1

I'm trying to use PDO driver to access the database:
 my database config:
PHP Code:
public $default = [
        
'DSN'      => 'pgsql:host=localhost;port=3306;dbname=cipm',//I add this based on documention
        
'hostname' => 'localhost',
        
'username' => 'root',
        
'password' => '123',
        
'database' => 'cipm',
        
//'DBDriver' => 'MySQLi',
        
'DBDriver' => 'PDO',
        
'DBPrefix' => 'pr_',
        
'pConnect' => false,
        
'DBDebug'  => (ENVIRONMENT !== 'production'),
        
'cacheOn'  => false,
        
'cacheDir' => '',
        
'charset'  => 'utf8',
        
'DBCollat' => 'utf8mb4_general_ci',
        
'swapPre'  => '',
        
'encrypt'  => false,
        
'compress' => false,
        
'strictOn' => false,
        
'failover' => [],
        
'port'     => 3306,
    ]; 
error: 
Code:
Class '\CodeIgniter\Database\PDO\Connection' not found
Does CI 4.0.4 suppor PDO?
Reply
#2

Do a search in the forums here for ( CodeIgniter supported database drivers ) I gave some other user the driver list for version 3 and 4 of CodeIgniter.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

(09-15-2020, 08:28 AM)InsiteFX Wrote: Do a search in the forums here for ( CodeIgniter supported database drivers ) I gave some other user the driver list for version 3 and 4 of CodeIgniter.
It looks these are not PDO support for Codeigniter 4. at least I didn't find anything!
Reply
#4

Ya I just checked it's not in ver 4 yet, but I'm sure someone is working on it.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB