Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How can I export raw SQLite databases using PHP?

Posted on 2009-05-20
2
Medium Priority
?
347 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 19

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 19

Expert Comment

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

Featured Post

Industry Leaders: 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

Recently I was talking with Tim Sharp, one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. While doing some quick training with some of the Percona team, Tim brought something to my attention...
In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

609 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