473,671 Members | 2,287 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Database exporting

AJ
Hi all

As part of the CMS that I've written, I would like to give users the ability
to backup their own databases. Is there any way that this can be done with
PHP? What I'd like is for them to click a link and for it to create a txt
file and open the "Save as" dialog box so that they can save it off to their
hard drive.

Any help would be gratefully received.

Cheers

Andy
Jul 17 '05 #1
3 1775
AJ wrote:
Hi all

As part of the CMS that I've written, I would like to give users the ability
to backup their own databases. Is there any way that this can be done with
PHP? What I'd like is for them to click a link and for it to create a txt
file and open the "Save as" dialog box so that they can save it off to their
hard drive.

Any help would be gratefully received.

Cheers

Andy

Look at PHPmyAdmin's code...

Aphrael...
--
"La demande mondiale d’ordinateurs n’excédera pas cinq machines."
(Thomas Watson, Fondateur d'IBM, 1945)
Jul 17 '05 #2
AJ wrote:
Hi all

As part of the CMS that I've written, I would like to give users the ability
to backup their own databases. Is there any way that this can be done with
PHP? What I'd like is for them to click a link and for it to create a txt
file and open the "Save as" dialog box so that they can save it off to their
hard drive.

Any help would be gratefully received.


You have to options: you could use exec('mysqldump ') or the hardway (if
you're going to distribute your CMS this is the best mehod since your
not sure if you have access to exec() in PHP or mysqldump(8)) by
executing a SHOW TABLES, then looping trough those results and doing a
SELECT * FROM $table for each $tables as $table. It's not as simple as
it sounds since you also have to think about auto_increments , field
types (SHOW COLUMNS), PRIMARY KEYS, INDEXES, ...

--
Pieter Nobels
Jul 17 '05 #3
AJ wrote:
Hi all

As part of the CMS that I've written, I would like to give users the ability
to backup their own databases. Is there any way that this can be done with
PHP? What I'd like is for them to click a link and for it to create a txt
file and open the "Save as" dialog box so that they can save it off to their
hard drive.


If you use a wrapper like ADODB (they changed the site for it so you have to
google for it) there is a function that will output a recordset (result from
an SQL select) to a csv file. Another other option is to use the exec()
function and execute mysqldump. You can pass it a selection criteria and it
will only dump certain records from tables you choose.

We do BOTH on JAYA123. See the demo at link below. Go to Utilities/Edit
Settings, Make Backup and you will see the kind of results you can get.

Al Canton

Adams-Blake Company, Inc.
***
JAYA123 - the web-based total-office system for the
small biz. Order entry, billing, bookkeeping, etc. for $14.95
a month. Everyone says "It's cool as a moose!!"
See why at:http://www.jaya123.com ('ja-eye-ah' means
'victory' in Sanskrit.)
***

Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
11026
by: Tim Eliot | last post by:
Just wondering if anyone has hit the following issue and how you might have sorted it out. I am using the command: DoCmd.TransferText acExportMerge, , stDataSource, stFileName, True after setting stDataSource and stFileName to the desired values. Most of the time it works, but occasionally, typically as code changes are being made to the module, the following message appears:
2
1835
by: RC | last post by:
I am updating/improving a working database for a non-profit organization. I am thinking of making a copy of the database at the office, bringing the copy to my house, making the changes and then copying the new/improved database back to the hard drive of the PC at the office. While I am working on the copy of the database at home, the database has data being entered into it at the office. My question is: how can I copy the new database...
1
1926
by: Nathan Bloomfield | last post by:
Hi, I am a new database developer and would appreciate some advice on improving the efficiency of my database. The code below is an example of one of the more complex queries in the database (very basic in the scheme of things). Can anyone offer advice in improving the structure considering this database resides on a network with limited bandwidth. The query runs
4
5150
by: Brian K. | last post by:
I am trying to split up and secure a database that we've been using on a network for a few years, following the procedure listed in Q304932 from microsoft. I create a new blank database for the front end, and am able to import tables and link from the backend. Queries come in ok too. When I tried to import Modules, forms, and reports, most of them failed with the error: "File Not Found:...
8
6984
by: chippy | last post by:
Hi, I've a VB script that creates a Access object in a word doc. Here is the full script. It works for all but the Export. Which always fails with a 3011 error. If I do the same in Access as a straight Macro or script it works. Add it as an object and it won't work. HELP.
0
1118
by: Yovav | last post by:
I have an MS SQL account somewhere on the net and I had problems using DTS for import/export data as OBJECTs (which including things like IDENTITY fields and Primary key...) Though SP3 is updated on both edges - I just can get a working solution, I'm was trying to export Table data & schema using an
0
976
by: Ashish | last post by:
-- Anybody aware of an activeX control for exporting the Microsoft Outlook/ Outlook Express? I have found one : http://www.vbxtras.com/products/kswabactivexcontrol.asp (this is supporting Microsoft Outlook and NOT Outlook Express) Regards Ashish
2
2402
by: bienwell | last post by:
Hi, I have a question about exporting data from datagrid control into Excel file in ASP.NET. On my Web page, I have a linkbutton "Export data". This link will call a Sub Function to perform exporting ALL data from the datagrid control. Exporting data works fine when I show all data on the datagrid control. I'd like to shows only 30 records on the datagrid control instead of ALL data using page navigation, and perform exporting...
18
7426
by: BA | last post by:
Hello, Anyone know of an open source C# pure xml database that is available? I've done some looking around and can't locate anything. Thanks in advance, BA http://biztalkia.blogspot.com/
9
10209
by: Bob Sanderson | last post by:
I'm trying to export a table to an ODBC database using a VBA subroutine. I have tested the ODBC setup manually and it works fine but when I try to do it with VBA, I get a "connection failed" error. This is the code I'm using. Can anyone tell me what is wrong with it? DoCmd.TransferDatabase acExport, "ODBC Database", "ODBC;DSN=*****;UID=*****;LANGUAGE=us_english;" & "DATABASE=*****", acTable, "Test", "Test" Thanks in advance.
0
8393
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8917
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8821
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8598
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8670
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7437
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5696
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4407
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2812
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.