Welcome Guest, Not a member yet? Register   Sign In
troubles conecting to a sqlite database
#11

[eluser]plainas[/eluser]
[quote author="gtech" date="1194306327"]Ahhh! another brainwave after reading the code.. if you want some logging try setting your config.php log_threshold to 1 (error) or 2 (debug)... then codeingiter will log any database load errors.

config.php
Code:
$config['log_threshold'] = 1;

as log_message('error','<message>')

is used throughout the system\database\DB_driver.php file (which appears to load the configuration) at least then you can find out where it keels over. the log should appear in the /log directory of you install dir[/quote]

Ah!
that's handy... I will try that. Thank you.
I come back tomorrow to let you know how things are going.
#12

[eluser]Chris J Smith[/eluser]
Make sure you don't put your .db in the public part of the web site. Keep it somewhere that a basic http request can't get at it or you'll give away your data unknowingly!
#13

[eluser]plainas[/eluser]
thanks all for the help, I am using a mysql database for now.
Later I'll port it to sqlite and check it out better.
#14

[eluser]gtech[/eluser]
cool, will be good to see how you get on
#15

[eluser]zilverdistel[/eluser]
I have the same problem. I got one step further though. On [a]http://www.php.net/manual/en/ref.sqlite.php[/a] I found that you need to install an extension php_sqlite. On my linux box I did apt-get install php5-sqlite, and added the following line in my php.ini:

Code:
extension=php_sqlite.dll

This still didn't work, but at least I got some response from the system now:

Code:
An Error Was Encountered

unable to open database: /www/CodeIgniter_1.6.1/db/MyDB

nevertheless, as I type, I noticed that my 'db' directory was not readable for the webserver, after I fixed it, it seems to work (according to the logfile, befor it ended with Database Driver Class Initialized).

Code:
DEBUG - 2008-03-14 02:18:55 --&gt; Language Class Initialized
DEBUG - 2008-03-14 02:18:55 --&gt; Loader Class Initialized
DEBUG - 2008-03-14 02:18:55 --&gt; Controller Class Initialized
DEBUG - 2008-03-14 02:18:55 --&gt; Database Driver Class Initialized
DEBUG - 2008-03-14 02:18:55 --&gt; Final output sent to browser
DEBUG - 2008-03-14 02:18:55 --&gt; Total execution time: 0.2869

So, I hope this helps for other people. If you want to use sqlite, php must be compiled with support for it, or the php_sqlite (and php_pdo) extension must be installed and configured in your php.ini. For more info, see the above link to the php website.




Theme © iAndrew 2016 - Forum software by © MyBB