Click here to get back home

Opening Firefox 3 sqlite files

 HomeNewsGroups | Search | About
 comp.lang.php    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Opening Firefox 3 sqlite files Chuck Anderson 07-03-2008
Posted by Chuck Anderson on July 3, 2008, 11:25 pm
Please log in for more thread options
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.
***********************************


Posted by Chuck Anderson on July 5, 2008, 4:03 pm
Please log in for more thread options
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.
***********************************


Posted by David Gillen on July 9, 2008, 5:39 am
Please log in for more thread options
> 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.

Posted by Chuck Anderson on July 9, 2008, 7:23 pm
Please log in for more thread options
David Gillen wrote:
>
>> 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.
***********************************


Posted by Tim Streater on July 9, 2008, 6:24 am
Please log in for more thread options

> 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";
}

?>

Similar ThreadsPosted
SQLite DB using without SQLite Extension September 5, 2005, 12:40 pm
sqlite with PDO and sqlite extension July 4, 2008, 6:24 am
using sqlite 3 with php 5 November 18, 2005, 1:23 pm
sqlite/PHP under OS X June 19, 2008, 5:22 pm
Upgrading SQLite in PHP 5 January 24, 2005, 12:39 pm
New PHP Releases and PDO SQLite July 5, 2006, 8:55 am
SQLite Version 2.1? January 23, 2007, 8:26 am
Escaping SQLite October 1, 2007, 1:52 am
Best Practice -- PDO, SQLite? November 5, 2007, 10:50 pm
Using SQLite from PHP w/out recompiling? January 20, 2008, 3:42 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap