NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Setting up sqlite3


Joined: 28 Jan 2010
Posts: 2
Reply with quote
I am struggling getting sqlite3 (it is an ecrypted database) working with a fresh download of phpdock. When I run phpinfo on the server, I notice that the server is saying that the pdo_sqlite driver for Sqlite 3.x is enabled.

From PHPinfo:

PHP Version 5.2.5

pdo_sqlite
PDO Driver for SQLite 3.x -- enabled
PECL Module version -- 1.0.1 $Id: pdo_sqlite.c,v 1.10.2.6.2.2 2007/03/23 14:30:00 wez Exp $
SQLite Library -- 3.3.17undefined

SQLite
SQLite support -- enabled
PECL Module version -- 2.0-dev $Id: sqlite.c,v 1.166.2.13.2.9 2007/05/19 17:58:22 iliaa Exp $
SQLite Library -- 2.8.17
SQLite Encoding -- iso8859


I did not make any changes to the php installation (I am actually not very sure if any changes are needed to get sqlite3 to work with this version of php).

When I ran the following PDO script, no errors were thrown. The unusual part was an error was not thrown when I gave an invalid password or even an invalid DB name. When I tried to execute a SELECT query, the query failed. This is my first time working with PDO or SQLite3, so I am not sure where to look or what else to try. Any help would be greatly appreciated.

//connect to the sqlite3 DB
try{
$dbHandle = new PDO('sqlite:'.$_SERVER['DOCUMENT_ROOT']."currDB.db3","","currPassword");
} catch(PDOException $exception ) {
die($exception->getMessage());
}

//query code
$query = "SELECT * FROM login";

if($result = $dbHandle->query($query))
{
foreach ($result as $row) {
print $row['loginID'] . "\t";
print $row['firstName'] . "\n";
}
}
else
{
echo 'fail';
}

Thanks,

--Joe
View user's profileFind all posts by nalodSend private message
Setting up sqlite3
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic