CodeIgniter Forums
SQLite problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: SQLite problem (/thread-11014.html)

Pages: 1 2


SQLite problem - El Forum - 08-22-2008

[eluser]hostingx[/eluser]
Hi all!

I have a small problem with SQLite (never used it before..)

I have set up the path to the db file:
Code:
$active_group = "default";
$active_record = TRUE;

$db['default']['hostname'] = "localhost";
$db['default']['username'] = "";
$db['default']['password'] = "";
$db['default']['database'] = "database/registry.db";
$db['default']['dbdriver'] = "sqlite";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";

But then i get an error:

Quote:A Database Error Occurred

file is encrypted or is not a database


What am i doing wrong? Hope someone can help me out here!


SQLite problem - El Forum - 04-06-2009

[eluser]lbolognini[/eluser]
[quote author="hostingx" date="1219421384"]

But then i get an error:

Quote:A Database Error Occurred

file is encrypted or is not a database


What am i doing wrong? Hope someone can help me out here![/quote]

Hi, getting the same error, did you find a fix? I'm using CI 1.7.1, do i need to apply the patches mentioned in the Wiki with this version? My SQLite file is version 3.

http://codeigniter.com/wiki/PDO_SQLite3/

L.


SQLite problem - El Forum - 04-06-2009

[eluser]TheFuzzy0ne[/eluser]
Have you checked your file permissions on the database directory and child files?


SQLite problem - El Forum - 04-06-2009

[eluser]lbolognini[/eluser]
[quote author="TheFuzzy0ne" date="1239036911"]Have you checked your file permissions on the database directory and child files?[/quote]

Yeah it's not a permission problem. I'm quite sure it's because the file i created was a SQLite 3 file. Does CI support v 3 at all?

Once i created a SQLite 2 file everything went fine, but that's a bit of a bummer for me.

L.


SQLite problem - El Forum - 04-06-2009

[eluser]TheFuzzy0ne[/eluser]
As far as I know, CodeIgniter should work either either version. It sounds to me like it's your server that doesn't support SQLite 3.


SQLite problem - El Forum - 04-06-2009

[eluser]lbolognini[/eluser]
[quote author="TheFuzzy0ne" date="1239039658"]As far as I know, CodeIgniter should work either either version. It sounds to me like it's your server that doesn't support SQLite 3.[/quote]

Not sure, in php.ini i have:

extension=php_pdo.dll
extension=php_pdo_sqlite.dll
extension=php_pdo_sqlite_external.dll
extension=php_pdo_user.dll

My database.php says:

$db['default']['dbdriver'] = "sqlite";

What else should i check?

Thanks,
L.


SQLite problem - El Forum - 04-06-2009

[eluser]TheFuzzy0ne[/eluser]
When the database driver has been loaded:
Code:
echo $this->db->_version();



SQLite problem - El Forum - 04-06-2009

[eluser]lbolognini[/eluser]
[quote author="TheFuzzy0ne" date="1239041533"]When the database driver has been loaded:
Code:
echo $this->db->_version();
[/quote]

I've got 2.8.17 ... interesting, how do i get it to run version 3? Also, provided i get to run version 3, will it work on hosts that only support PHP 4?

Thanks,
L.


SQLite problem - El Forum - 04-06-2009

[eluser]TheFuzzy0ne[/eluser]
The PHP version is irrelevant as SQLite 3 is supported by both PHP 4 and PHP 5. What matters is what version of the library is currently installed, or in your case, which is the default.

I'd suggest you take it up with your Web host, and ask them:
a) Which version(s) they have installed, and if 3 is installed,
b) How can you get it working within your set-up.

Sorry I couldn't be of better assistance.


SQLite problem - El Forum - 04-06-2009

[eluser]lbolognini[/eluser]
[quote author="TheFuzzy0ne" date="1239042991"]The PHP version is irrelevant as SQLite 3 is supported by both PHP 4 and PHP 5. What matters is what version of the library is currently installed, or in your case, which is the default.

Sorry I couldn't be of better assistance.[/quote]

That's great thanks, knowing it's possible i'll work it out.

L.