PDO in CodeIgniter 2.2.1 - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6) +--- Forum: CodeIgniter 2.x (https://forum.codeigniter.com/forumdisplay.php?fid=18) +--- Thread: PDO in CodeIgniter 2.2.1 (/showthread.php?tid=1175) |
PDO in CodeIgniter 2.2.1 - Kenneth_H - 02-16-2015 Hi I have tried to switch from mysql db driver to pdo and now I just got a blank white page with nothing on it and this in my php error log: Code: [16-Feb-2015 18:41:45 Europe/Berlin] PHP Fatal error: Uncaught exception 'PDOException' with message 'invalid data source name' in /Applications/MAMP/htdocs/ignitercms/system/database/drivers/pdo/pdo_driver.php:114 I know that my PHP configuration can work with PDO as I have done custom application with no framework and used PDO with no issues. This is the content of config/database.php PHP Code: $active_group = 'default'; There is nothing in the user guide related to using PDO under the database class. I have found this project: https://github.com/cickes/PDOinCodeigniter2 But since there is a pdo driver in CI 2.2.1 I would think that it is actually supported, so there should be no need to replace the DB.php in the core. Any suggestion on how to fix this? RE: PDO in CodeIgniter 2.2.1 - Narf - 02-16-2015 Use mysqli or upgrade to 3.0rc2. PDO support in CI2 was experimental and as such has a lot of issues. With CI's abstractions on top of it, you gain nothing from using PDO anyway ... People will recommend it to you because it's easier to use on its own, but you're not accessing it directly. RE: PDO in CodeIgniter 2.2.1 - 6801 - 03-23-2015 hi PHP Code: $db['default']['hostname'] = 'mysql:host=localhost;dbname=root;'; file attach onwrite in path : Code: system\database\drivers |