CodeIgniter Forums
How can I use PDO in CI3. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6)
+--- Forum: CodeIgniter 3.x (https://forum.codeigniter.com/forumdisplay.php?fid=17)
+--- Thread: How can I use PDO in CI3. (/showthread.php?tid=1081)



How can I use PDO in CI3. - Vimal - 02-10-2015

I searched on google. But not found any proper solution. Confused


RE: How can I use PDO in CI3. - Rufnex - 02-10-2015

Try this in your database configuration (e.g. for mysql)

PHP Code:
    'dsn'    => 'mysql:host=host_name;dbname=db_name',
    
'username' => 'usr',
    
'password' => 'pw',
    
'database' => 'db',
    
'dbdriver' => 'pdo'



RE: How can I use PDO in CI3. - Vimal - 02-10-2015

If i config only 'dsn' than i think 'database' and 'server' field will not use if i comment both than its not work but when i comment out dsn than its also works.

And 'dbdriver' => 'pdo' // show me invalid data driver Sad


RE: How can I use PDO in CI3. - Vimal - 02-10-2015

Its working now. what the hell with yesterday same setting but not worked yesterday but wholla works today fine. Smile