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
    Regular Coder
    Join Date
    Jul 2005
    Posts
    216
    Thanks
    0
    Thanked 0 Times in 0 Posts

    saving Database to file

    How would you go abouts saving all data in the mysql to a file and download it? I know how to retreive the data and write it (dont know how to make a download button) but how do i record the table data, such as make them inserts like you would in phpmyadmin. Then with a click of the button in mysqlsave.php, it retrieves the information, saves it to mysqlDATA.doc and then downloads it to your hard drive?

  • #2
    Regular Coder googleit's Avatar
    Join Date
    Jul 2006
    Location
    birmingham, uk
    Posts
    189
    Thanks
    0
    Thanked 0 Times in 0 Posts
    edit// sorry miss read the question

  • #3
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,633
    Thanks
    4
    Thanked 148 Times in 139 Posts
    you would have to write your mysqlsave php file as one that calls a script. that script would run a mysqldump call. you would have to write a separate script for the reload.

  • #4
    Regular Coder
    Join Date
    Jul 2005
    Posts
    216
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by guelphdad View Post
    you would have to write your mysqlsave php file as one that calls a script. that script would run a mysqldump call. you would have to write a separate script for the reload.
    mysqldump as in a command or me calling every row

  • #5
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,633
    Thanks
    4
    Thanked 148 Times in 139 Posts
    mysqldump is a command you can run from the command prompt or shell. you can run it in a script with a cron job.

    mysqldump dumps your entire database with all tables and inserts for all rows of every table. you can also specify with options that you only want certain tables from the database, or the table structure only without data etc.


  •  

    Posting Permissions

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