Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-25-2003, 08:19 PM   PM User | #1
sametch
New Coder

 
Join Date: Jan 2003
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
sametch is an unknown quantity at this point
Backing up a MySQL database by email. Is it possible?

In PHPMyAdmin there is a way you can select all tables in a database and send a text file by email that enables the database and its contents to be reconstructed with SQL.

I would like to do a similar thing using PHP for a database I have designed in MySQL.

I would like a single button which when clicked would send an email to the webmasters email address. The email would contain the SQL code to recreate the database and insert all records.

Is this possible?

Could anyone advise how I could do it?
sametch is offline   Reply With Quote
Old 09-25-2003, 09:01 PM   PM User | #2
Nightfire
Senior Coder

 
Nightfire's Avatar
 
Join Date: Jun 2002
Posts: 4,266
Thanks: 6
Thanked 48 Times in 48 Posts
Nightfire is on a distinguished road
Possible, yes. As you have phpmyadmin, take a look how that view dumps the data and work around that For telling you how it's done, I have no idea as I just let my control panel sort all that out for me
__________________
Blue Panda
Website Design | 1 Pound Ads | 'ow much? | Coding Geeks
Nightfire is offline   Reply With Quote
Old 09-25-2003, 09:22 PM   PM User | #3
sametch
New Coder

 
Join Date: Jan 2003
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
sametch is an unknown quantity at this point
I did try that, but I am fairly new to PHP and I am struggling to follow the code. Just an idea of the functions required might help, then I can research then on the php website.
sametch is offline   Reply With Quote
Old 09-25-2003, 11:01 PM   PM User | #4
Nightfire
Senior Coder

 
Nightfire's Avatar
 
Join Date: Jun 2002
Posts: 4,266
Thanks: 6
Thanked 48 Times in 48 Posts
Nightfire is on a distinguished road
I'll be downloading phpmyadmin tonight, so I'll see what I can find out from it later on
__________________
Blue Panda
Website Design | 1 Pound Ads | 'ow much? | Coding Geeks
Nightfire is offline   Reply With Quote
Old 09-25-2003, 11:09 PM   PM User | #5
Nightfire
Senior Coder

 
Nightfire's Avatar
 
Join Date: Jun 2002
Posts: 4,266
Thanks: 6
Thanked 48 Times in 48 Posts
Nightfire is on a distinguished road
Just been looking on mysql.com and found this, might be what you're looking for

http://www.mysql.com/doc/en/mysqldump.html

Do the db query, save results to a file, once saved send off the email with the file as an attachment, then atleast if the email fails, you'll still have the file on your server.
__________________
Blue Panda
Website Design | 1 Pound Ads | 'ow much? | Coding Geeks
Nightfire is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:58 PM.


Advertisement
Log in to turn off these ads.