Solved

How can I export raw SQLite databases using PHP?

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

APEX (Application Express) is used to develop a web application from Oracle. SQL Workshop is one of the tools that comes with Oracle APEX to query or modify the database objects or to make any changes to the structure.
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

758 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

20 Experts available now in Live!

Get 1:1 Help Now