Solved

How can I export raw SQLite databases using PHP?

Posted on 2009-05-20
2
339 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 19

Accepted Solution

by:
NerdsOfTech earned 500 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

862 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now