0

my local web server on one machine running Ubuntu 11.04 works fine using php5 to access sqlite3 - however on a new machine running Ubuntu 11.10 the same code, same structure, does not work at all - even though phpinfo() indicates all modules are enabled.

Any idea's on how to solve this issue?

phpinfo() on my Ubuntu 11.04 machine indicates PHP Version 5.3.5-1ubuntu7.3 but the newer Ubuntu 11.10 only supports PHP Version 5.3.6-13ubuntu3.2 ?

Why has it gone back to Ubuntu3.2?

The php code seems to be able open the database file ok, but fails when accessing a Sqlite query in the code below?

$result = $db->query('SELECT * FROM sysconfig');
$data = $result->fetchArray(SQLITE_NUM);

The variable $data returns null (however it returns data on Ubuntu 11.04 - ok)

frank

1

2 Answers 2

1

You're executing the query without checking whether its return value is sane. You may get clues as to why this is failing by looking at the return value from this:

$result = $db->query('SELECT * FROM sysconfig');

Remember that $result will be FALSE if the query didn't execute successfully. So after that line you can do:

if (!$result) {
  echo($db->lastErrorMsg());
}
0

Ensure you've installed the php5-sqlite package.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .