CodeIgniter Forums
Using PDO for database connection - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Using PDO for database connection (/showthread.php?tid=77550)



Using PDO for database connection - pars1997 - 09-15-2020

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?


RE: Using PDO for database connection - InsiteFX - 09-15-2020

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.


RE: Using PDO for database connection - pars1997 - 09-16-2020

(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!


RE: Using PDO for database connection - InsiteFX - 09-16-2020

Ya I just checked it's not in ver 4 yet, but I'm sure someone is working on it.