Welcome Guest, Not a member yet? Register   Sign In
Trying to connect to SQLite database
#1

[eluser]imorris[/eluser]
I'm using CI 1.73 and the SQLite DB driver (http://codeigniter.com/wiki/PDO_SQLite3/) to connect to a sqlite database.

I can successfully connect to the database using plain php code:

Code:
<p>PDO TEST: SQLITE 3.x</p>
&lt;?php        
$connection = new PDO('sqlite:/home/hci/LabResend');    
$handle = $connection->query("SELECT * FROM tbl1");      
if($handle){        
    $result = $handle->fetchAll(PDO::FETCH_ASSOC);        
    print("<pre>".print_r($result,true)."</pre>");    
}else{        
    var_dump($connection->errorInfo());        
    print("query returned negatively");    
} ?&gt;

...but I can't connect to the database using Codeigniter's database driver. Can someone help?

Code:
$active_group = "default";
$active_record = TRUE;

$db['default']['hostname'] = '';
$db['default']['username'] = '';
$db['default']['password'] = '';
$db['default']['database'] = 'sqlite:'./database/LabResend';
$db['default']['dbdriver'] = 'pdo';
$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";


Messages In This Thread
Trying to connect to SQLite database - by El Forum - 02-04-2011, 01:29 PM
Trying to connect to SQLite database - by El Forum - 02-04-2011, 02:27 PM
Trying to connect to SQLite database - by El Forum - 03-13-2011, 04:58 AM
Trying to connect to SQLite database - by El Forum - 03-14-2011, 01:41 PM



Theme © iAndrew 2016 - Forum software by © MyBB