473,385 Members | 1,925 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 2613
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: achan | last post by:
I recently bought a new PC runnning in XP. I downloaded and installed PySqlite 0.4.3win32 for Python 2.3. My Python23/Lib/Site-Packages/SQlite/ now has files __init__.py and main.py. However,...
1
by: DurumDara | last post by:
Hi ! I want to process many data with python, and want to store in database. In the prior version of my code I create a simple thing that delete the old results, recreate the database and fill...
1
by: David Fowler | last post by:
I'm new to getting in touch with other PHP users/PHP team, so please excuse me if this post is at all inappropriate or in the wrong place. In the current release of PHP (5.1.4) and in the CVS for...
4
by: Jim Carlock | last post by:
I added the following lines to PHP.INI. extension=php_pdo.dll extension=php_pdo_sqlite.dll extension=php_sqlite.dll specifically in that order. I noticed the extensions getting loaded are...
14
by: 7stud | last post by:
Does sqlite come in a mac version? Thanks.
7
devikacs
by: devikacs | last post by:
hi i'm not sure this is the right forum to post my question. Everytime i try to start mozilla firefox, i get a popup saying use IE and it closes. I tried removing firefox from add/remove programs,...
3
by: ricardo.turpino | last post by:
Hi, I've installed Mac Python 2.5. I'm running Mac OS X 10.4.10 on a Macbook 1.83GHz. I though that the python sqlite library was installed by default as part of Mac Python 2.5, however, I...
8
by: Gilles Ganault | last post by:
Hello I need to compile PHP5 with SQLite statically and without PDO. I don't need DB-independence, so it's fine using sqlite_*() functions instead of PDO. 1. I've downloaded, compiled, and...
20
by: timotoole | last post by:
Hi all, On a (sun) webserver that I use, there is python 2.5.1 installed. I'd like to use sqlite3 with this, however sqlite3 is not installed on the webserver. If I were able to compile sqlite...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.