Welcome Guest, Not a member yet? Register   Sign In
How to Create a SQLite ?
#1

[eluser]Unknown[/eluser]
Hello,

I’ve been examining the DB class with the intent of creating a Driver/ Der vied class for SQLite, My basic question is what approach should i take?
My current intention is simply to create a derived class and instantiate that when i need access to a SQLite db?

Any suggestions?
#2

[eluser]bretticus[/eluser]
Here in the CI Wiki someone shows how to use php's PDO extension (you may have to install this module via pecl, etc.) It is also a database abstraction. It abstracts SQLite apparently.
#3

[eluser]mooders[/eluser]
I have been trying to get CI 1.7.1; PHP 5.2.6; SQLite3 working together for a while now - no luck so far...

I have downloaded the files in the Wiki (linked elsewhere in this thread), applied the new functions for CI versions 1.6.x, uncommented the php_pdo and php_pdo_sqlite extensions in php.ini, made sure my database name is 'sqlite:xxxx.db3' and the driver 'pdo'.

And yet I still get this error:
"Fatal error: Call to undefined method CI_DB_pdo_driver::trans_rollback() in /Path/to/webroot/example/system/database/DB_driver.php on line 531"

Any help available? Any guidance very much appreciated.

Thanks,

Neil
#4

[eluser]kgill[/eluser]
It's pretty much exactly what the error message says, your PDO driver is missing the function trans_rollback(), add it to the pdo_driver.php class and that will make DB_driver.php happy. As to what to add just stub out the function:

Code:
function trans_rollback() {
return false
}

Basically you're not going to be using transactions but the functions have to be there otherwise DB_driver will throw an error.
#5

[eluser]mooders[/eluser]
Thanks kgill - that's helped!




Theme © iAndrew 2016 - Forum software by © MyBB