CodeIgniter PDO-optimized version.