I created a php web application using codeigniter using pdo driver, my settings:
$active_group = 'default';
$active_record = TRUE;
$db['default']['hostname'] = 'mysql:host=localhost;dbname=testDB';
$db['default']['username'] = 'root';
$db['default']['password'] = '';
$db['default']['database'] = 'testDB';
$db['default']['dbdriver'] = 'pdo';
...
Everything works fine. Now, I want to create a REST API for the same so, I decided to use REST_Controller (Codeignitor REST Server). Now, when I use the above settings, it doesn't work. The database queries inside the library don't work, instead return empty result when I debugged. Setting the database driver to mysql works however. Since, my REST server will use the queries I have already written in PDO, I want to use PDO here also, but it is not working. I am using X-API-KEY method. Can someone help me out with this!
This is a bug in codeignitor 2.x branch and is fixed in 3.x devel branch.
I'm having the same probs with CodeIgniter 2 & REST_Controller. Perhaps we can work on a hotfix? Any idea what causes this bug?
Edit: Fixed it!
You need to replace the following folders/files with the latest CI3 version of these folders/files (https://github.com/EllisLab/CodeIgniter).
Et voila, works.
Note: 3.0 is not released yet, however I don't see any PDO / database related issues listed on Github. Based on this I assume it's safe to update these files.