Using SQLite3 on 1&1 or elsewhere that does not have it installed

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

This might be better posted on the PHP newsgroup (and in fact I will=20
crosspost it there), but I thought it might be helpful for anyone else =
may be using SQLite3 instead of the more popular and ubiquitous MySQL, =
I should use it as well, but for now I just want to take the easy route. =

Here is the text from my post on the 1&1 forum which you may follow if =
wish :

"I just recently finished changing over from Dreamhost to 1&1, and I =
that my PHP scripts would not work. They failed when they encountered=20
functions for SQLite3, which was installed on Dreamhost, but 1&1 has =
SQLite2, which is incompatible. After some searching and fiddling, I =
that 1&1 does have a PDO module which allows at least some functionality =
SQLite3. Briefly, here are the changes I needed to make: "

//$db = new SQLite3($dbFile); // worked previously with SQLite3 =
on Dreamhost
$db = new PDO('sqlite:BGFemail.db'); // success
//$result = $sql->fetchArray();
$result = $sql->fetch();
// while ($row = $qres->fetcharray(SQLITE3_BOTH)) {
while ($row = $qres->fetch(SQLITE_BOTH)) {

"The commented code is what did not work, and following each line is =
that does work. "

"I'd like to be able to use my $dbFile variable for the database name =
but it=20
did not seem to work with the required sqlite: prefix. I'll try again. =
I used the wrong syntax for concatenation. I use various languages such =
JavaScript and Delphi and C and they are all different. "


Site Timeline