Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jan 2003
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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?

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    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

  • #3
    New Coder
    Join Date
    Jan 2003
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #4
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    I'll be downloading phpmyadmin tonight, so I'll see what I can find out from it later on

  • #5
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •