?
Solved

How can I export raw SQLite databases using PHP?

Posted on 2009-05-20
2
Medium Priority
?
350 Views
Last Modified: 2013-12-12
Hello,

I need to be able to export a raw SQLite database into a file using PHP. This is so that I can download this file from the server and use it with other applications.

I'm experienced in PHP and SQL, I know how to create and manage databases, but I can't figure out how to export in the raw database format. It always seems to want to export as SQL statements, which is not what I want, I need the raw format.

Thanks,
Steve
0
Comment
Question by:flashjordan
  • 2
2 Comments
 
LVL 20

Accepted Solution

by:
NerdsOfTech earned 2000 total points
ID: 24436771
use: sqlite_factory()
http://us2.php.net/manual/en/function.sqlite-factory.php
<?php
$dbhandle = sqlite_factory('sqlitedb');
$dbhandle->query('SELECT user_id, username FROM users');
 
/* functionally equivalent to: */
 
$dbhandle = new SQLiteDatabase('sqlitedb');
$dbhandle->query('SELECT user_id, username FROM users');
 
?>

Open in new window

0
 
LVL 20

Expert Comment

by:NerdsOfTech
ID: 24436779
A SQLiteDatabase object is returned rather than a resource :)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lotus Notes has been used since a very long time as an e-mail client and is very popular because of it's unmatched security. In this article we are going to learn about  RRV Bucket corruption and understand various methods to Fix "RRV Bucket Corrupt…
How much do you know about the future of data centers? If you're like 50% of organizations, then it's probably not enough. Read on to get up to speed on this emerging field.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Suggested Courses
Course of the Month13 days, 13 hours left to enroll

755 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question