Connecting Tech Pros Worldwide Help | Site Map

Opening Firefox 3 sqlite files

Chuck Anderson
Guest
 
Posts: n/a
#1: Jul 4 '08
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.
***********************************

Chuck Anderson
Guest
 
Posts: n/a
#2: Jul 5 '08

re: Opening Firefox 3 sqlite files


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.
***********************************

David Gillen
Guest
 
Posts: n/a
#3: Jul 9 '08

re: Opening Firefox 3 sqlite files


On Sat, 5 Jul 2008 Chuck Anderson <websiteaddress@seemy.sigwrote:
Quote:
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.
Tim Streater
Guest
 
Posts: n/a
#4: Jul 9 '08

re: Opening Firefox 3 sqlite files


In article <qu2dnXh3ydsQTvLVnZ2dnUVZ_rjinZ2d@comcast.com>,
Chuck Anderson <websiteaddress@seemy.sigwrote:
Quote:
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";
}

?>
Chuck Anderson
Guest
 
Posts: n/a
#5: Jul 10 '08

re: Opening Firefox 3 sqlite files


Tim Streater wrote:
Quote:
In article <qu2dnXh3ydsQTvLVnZ2dnUVZ_rjinZ2d@comcast.com>,
Chuck Anderson <websiteaddress@seemy.sigwrote:
>
>
Quote:
>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.
***********************************

Chuck Anderson
Guest
 
Posts: n/a
#6: Jul 10 '08

re: Opening Firefox 3 sqlite files


David Gillen wrote:
Quote:
On Sat, 5 Jul 2008 Chuck Anderson <websiteaddress@seemy.sigwrote:
>
Quote:
>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.
***********************************

Tim Streater
Guest
 
Posts: n/a
#7: Jul 10 '08

re: Opening Firefox 3 sqlite files


In article <5fGdnYwYLPVJ2ujVnZ2dnUVZ_t_inZ2d@comcast.com>,
Chuck Anderson <websiteaddress@seemy.sigwrote:
Quote:
Tim Streater wrote:
Quote:
In article <qu2dnXh3ydsQTvLVnZ2dnUVZ_rjinZ2d@comcast.com>,
Chuck Anderson <websiteaddress@seemy.sigwrote:

Quote:
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]
Quote:
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.
AnrDaemon
Guest
 
Posts: n/a
#8: Jul 11 '08

re: Opening Firefox 3 sqlite files


Greetings, Tim Streater.
In reply to Your message dated Wednesday, July 9, 2008, 14:24:09,
Quote:
Quote:
>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?
Quote:
Try this code:
Quote:
<?
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 <anrdaemon@freemail.ru>

Tim Streater
Guest
 
Posts: n/a
#9: Jul 11 '08

re: Opening Firefox 3 sqlite files


In article <1461817766.20080711041901@freemail.ru>,
AnrDaemon <anrdaemon@freemail.ruwrote:
Quote:
Greetings, Tim Streater.
In reply to Your message dated Wednesday, July 9, 2008, 14:24:09,
>
Quote:
Quote:
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?
>
Quote:
Try this code:
>
Quote:
<?
>
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?
Peter H. Coffin
Guest
 
Posts: n/a
#10: Jul 21 '08

re: Opening Firefox 3 sqlite files


On Fri, 11 Jul 2008 10:41:15 +0100, Tim Streater wrote:
Quote:
In article <1461817766.20080711041901@freemail.ru>,
AnrDaemon <anrdaemon@freemail.ruwrote:
>
Quote:
>Greetings, Tim Streater.
>In reply to Your message dated Wednesday, July 9, 2008, 14:24:09,
>>
Quote:
>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?
>>
Quote:
Try this code:
>>
Quote:
<?
>>
>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
Tim Streater
Guest
 
Posts: n/a
#11: Jul 21 '08

re: Opening Firefox 3 sqlite files


In article <slrng87oq5.uuk.hellsop@abyss.ninehells.com>,
"Peter H. Coffin" <hellsop@ninehells.comwrote:
Quote:
On Fri, 11 Jul 2008 10:41:15 +0100, Tim Streater wrote:
Quote:
In article <1461817766.20080711041901@freemail.ru>,
AnrDaemon <anrdaemon@freemail.ruwrote:
Quote:
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.
Closed Thread