469,928 Members | 1,852 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,928 developers. It's quick & easy.

Opening Firefox 3 sqlite files

Firefox 3 uses sqlite files for bookmarks, browse history, form
history, cookies, ......

When I execute :
$sqlite_db_file = 'cookies.sqlite';
$db = sqlite_open($sqlite_db_file, 0666, $sqlite_error);

I get the following error:
Error: file is encrypted or is not a database.

(using Php5.2.5 on Windows XP)

Has anyone had any luck opening the Firefox sqlite files with the Php
sqlite library functions?

--
*****************************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Nothing he's got he really needs
Twenty first century schizoid man.
***********************************

Jul 4 '08 #1
10 2442
I figured out how to get at my firefox sqlite files. I need to use the
PDO functions as they are in sqlite 3 format.

Anyway .... what I want to do now is the equivalent of SHOW COLUMNS (in
MySQL), so that I can open any table and see it's structure. I have yet
to find a way. Does anyone know how to use PDO SQLite to display a
tables columns?

--
*****************************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Nothing he's got he really needs
Twenty first century schizoid man.
***********************************

Jul 5 '08 #2
On Sat, 5 Jul 2008 Chuck Anderson <we************@seemy.sigwrote:
I figured out how to get at my firefox sqlite files. I need to use the
PDO functions as they are in sqlite 3 format.

Anyway .... what I want to do now is the equivalent of SHOW COLUMNS (in
MySQL), so that I can open any table and see it's structure. I have yet
to find a way. Does anyone know how to use PDO SQLite to display a
tables columns?
Google "firefox extension sqlite manager" if you just want to take a look at
the contents.

D.
--
God kicks with both feet and keeps his shoes clean.
Jul 9 '08 #3
In article <qu******************************@comcast.com>,
Chuck Anderson <we************@seemy.sigwrote:
I figured out how to get at my firefox sqlite files. I need to use the
PDO functions as they are in sqlite 3 format.

Anyway .... what I want to do now is the equivalent of SHOW COLUMNS (in
MySQL), so that I can open any table and see it's structure. I have yet
to find a way. Does anyone know how to use PDO SQLite to display a
tables columns?
Try this code:

<?

echo "\nDatabase dumper V001\n\n";

echo "Enter database name: ";
$database = trim (fgets (STDIN), "\n ");
echo "\n";

if (file_exists($database)==false)
{
echo "Error - database does not exist\n\n";
echo "Abnormal termination\n\n";
exit ();
}

echo "Enter table name: ";
$table = trim (fgets (STDIN), "\n ");
echo "\n";

$dbh = new PDO ("sqlite:" . $database);

$resq = $dbh->query ("PRAGMA table_info(" . $table . ")");
$cols = $resq->fetchAll (PDO::FETCH_BOTH);
$num = count ($cols);
echo "Number of columns = " . $num . "\n\n";
for ($i=0; $i<$num; $i++)
{
$numfld = count ($cols[$i]);
for ($j=0; $j<$numfld; $j++)
{
echo $cols[$i][$j] . " ";
}
echo "\n";
}

?>
Jul 9 '08 #4
Tim Streater wrote:
In article <qu******************************@comcast.com>,
Chuck Anderson <we************@seemy.sigwrote:

>I figured out how to get at my firefox sqlite files. I need to use the
PDO functions as they are in sqlite 3 format.

Anyway .... what I want to do now is the equivalent of SHOW COLUMNS (in
MySQL), so that I can open any table and see it's structure. I have yet
to find a way. Does anyone know how to use PDO SQLite to display a
tables columns?

Try this code:

<?

echo "\nDatabase dumper V001\n\n";

echo "Enter database name: ";
$database = trim (fgets (STDIN), "\n ");
echo "\n";

if (file_exists($database)==false)
{
echo "Error - database does not exist\n\n";
echo "Abnormal termination\n\n";
exit ();
}

echo "Enter table name: ";
$table = trim (fgets (STDIN), "\n ");
echo "\n";

$dbh = new PDO ("sqlite:" . $database);

$resq = $dbh->query ("PRAGMA table_info(" . $table . ")");
$cols = $resq->fetchAll (PDO::FETCH_BOTH);
$num = count ($cols);
echo "Number of columns = " . $num . "\n\n";
for ($i=0; $i<$num; $i++)
{
$numfld = count ($cols[$i]);
for ($j=0; $j<$numfld; $j++)
{
echo $cols[$i][$j] . " ";
}
echo "\n";
}

?>
Excellent. Thank you!

And now knowing what search for, I'm reading the sqlite PRAGMA
statements reference:
http://www.sqlite.org/pragma.html

Thanks!

(Getting past this hurdle was important for me. Now I can open and view
any (most?) sqlite database files.)

--
*****************************
Chuck Anderson Boulder, CO
http://www.CycleTourist.com
Nothing he's got he really needs
Twenty first century schizoid man.
***********************************

Jul 9 '08 #5
David Gillen wrote:
On Sat, 5 Jul 2008 Chuck Anderson <we************@seemy.sigwrote:
>I figured out how to get at my firefox sqlite files. I need to use the
PDO functions as they are in sqlite 3 format.

Anyway .... what I want to do now is the equivalent of SHOW COLUMNS (in
MySQL), so that I can open any table and see it's structure. I have yet
to find a way. Does anyone know how to use PDO SQLite to display a
tables columns?

Google "firefox extension sqlite manager" if you just want to take a look at
the contents.

D.
Yep. I've already got that. I wanted to be able to write my own sqlite
handling routines, though, too.

But, thanks.

--
*****************************
Chuck Anderson Boulder, CO
http://www.CycleTourist.com
Nothing he's got he really needs
Twenty first century schizoid man.
***********************************

Jul 9 '08 #6
In article <5f******************************@comcast.com>,
Chuck Anderson <we************@seemy.sigwrote:
Tim Streater wrote:
In article <qu******************************@comcast.com>,
Chuck Anderson <we************@seemy.sigwrote:

I figured out how to get at my firefox sqlite files. I need to use the
PDO functions as they are in sqlite 3 format.

Anyway .... what I want to do now is the equivalent of SHOW COLUMNS (in
MySQL), so that I can open any table and see it's structure. I have yet
to find a way. Does anyone know how to use PDO SQLite to display a
tables columns?
Try this code:
[snip]
Excellent. Thank you!

And now knowing what search for, I'm reading the sqlite PRAGMA
statements reference:
http://www.sqlite.org/pragma.html

Thanks!

(Getting past this hurdle was important for me. Now I can open and view
any (most?) sqlite database files.)
You're welcome. I only found out about pragma myself the other day from
another post. Well - I'd seen it on the sqlite site but somehow it
hadn't struck me that that was what I needed.
Jul 10 '08 #7
Greetings, Tim Streater.
In reply to Your message dated Wednesday, July 9, 2008, 14:24:09,
>I figured out how to get at my firefox sqlite files. I need to use the
PDO functions as they are in sqlite 3 format.

Anyway .... what I want to do now is the equivalent of SHOW COLUMNS (in
MySQL), so that I can open any table and see it's structure. I have yet
to find a way. Does anyone know how to use PDO SQLite to display a
tables columns?
Try this code:
<?
Please DON'T use short open tags in examples. Even if you are using them in
your code (I dunno - why?), don't do that when you are providing examples.
--
Sincerely Yours, AnrDaemon <an*******@freemail.ru>

Jul 11 '08 #8
In article <14***********************@freemail.ru>,
AnrDaemon <an*******@freemail.ruwrote:
Greetings, Tim Streater.
In reply to Your message dated Wednesday, July 9, 2008, 14:24:09,
I figured out how to get at my firefox sqlite files. I need to use the
PDO functions as they are in sqlite 3 format.

Anyway .... what I want to do now is the equivalent of SHOW COLUMNS (in
MySQL), so that I can open any table and see it's structure. I have yet
to find a way. Does anyone know how to use PDO SQLite to display a
tables columns?
Try this code:
<?

Please DON'T use short open tags in examples. Even if you are using them in
your code (I dunno - why?), don't do that when you are providing examples.
Why not?
Jul 11 '08 #9
On Fri, 11 Jul 2008 10:41:15 +0100, Tim Streater wrote:
In article <14***********************@freemail.ru>,
AnrDaemon <an*******@freemail.ruwrote:
>Greetings, Tim Streater.
In reply to Your message dated Wednesday, July 9, 2008, 14:24:09,
>I figured out how to get at my firefox sqlite files. I need to use the
PDO functions as they are in sqlite 3 format.

Anyway .... what I want to do now is the equivalent of SHOW COLUMNS (in
MySQL), so that I can open any table and see it's structure. I have yet
to find a way. Does anyone know how to use PDO SQLite to display a
tables columns?
Try this code:
<?

Please DON'T use short open tags in examples. Even if you are using them in
your code (I dunno - why?), don't do that when you are providing examples.

Why not?
They mix poorly with XML documents, which start '<?XML'. The PHP
processor doens't have a "Use short tags that aren't XML tags" setting.

--
It is impossible to sharpen a pencil with a blunt axe. It is equally vain
to try to do it with ten blunt axes instead -- E.W Dijkstra, 1930-2002
Jul 21 '08 #10
In article <sl********************@abyss.ninehells.com>,
"Peter H. Coffin" <he*****@ninehells.comwrote:
On Fri, 11 Jul 2008 10:41:15 +0100, Tim Streater wrote:
In article <14***********************@freemail.ru>,
AnrDaemon <an*******@freemail.ruwrote:
Greetings, Tim Streater.
In reply to Your message dated Wednesday, July 9, 2008, 14:24:09,

I figured out how to get at my firefox sqlite files. I need to use the
PDO functions as they are in sqlite 3 format.

Anyway .... what I want to do now is the equivalent of SHOW COLUMNS (in
MySQL), so that I can open any table and see it's structure. I have
yet
to find a way. Does anyone know how to use PDO SQLite to display a
tables columns?

Try this code:

<?

Please DON'T use short open tags in examples. Even if you are using them
in
your code (I dunno - why?), don't do that when you are providing examples.
Why not?

They mix poorly with XML documents, which start '<?XML'. The PHP
processor doens't have a "Use short tags that aren't XML tags" setting.
Ah! A sensible reason. Thanks.
Jul 21 '08 #11

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by achan | last post: by
1 post views Thread by DurumDara | last post: by
1 post views Thread by David Fowler | last post: by
4 posts views Thread by Jim Carlock | last post: by
14 posts views Thread by 7stud | last post: by
3 posts views Thread by ricardo.turpino | last post: by
8 posts views Thread by Gilles Ganault | last post: by
20 posts views Thread by timotoole | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.