Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can I use php query to download MySQL database backup

Status
Not open for further replies.

ChrisMacPherson

Programmer
Jul 3, 2000
157
GB
Hi All,

I am designing a website for someone else and I want to include a page where they can download a backup copy of the MySQL database that they currently have. This should be done by pressing a button 'download backup' etc...

I normally get a backup using :

> mysql dbName > c:/backup_filename.sql

but I guess I cant do this from a button marked 'download backup'on a website, yeah?!


Is there an easy way to do this without having to write a script that copies all of the tables and then writes them to a file???

I will also want them to be able to upload the backup version incase the database gets lost, and so need another button 'reload backup version' etc.etc. using an upload script.

If this does make sense, and aint toooooo complicated then please help if you can. I'm not gonna spend too long on this at the rate they are paying me!!

thanks again

Chris MacPherson Chris MacPherson
macpweb@hotmail.com
Bring on the new Browza's!!
 
yeah I got that,

I want it to do the same thing as when you get it to print the SQL of the tables/database, but that only prints it to the screen.
I want it to create it in a file.

I guess if you can tell me how phpMyAdmin uses php to then print the sql (through PHP) then I can get that written to a file using fOpen or something and work from there.

thanks for you help
Chris MacPherson
macpweb@hotmail.com
Bring on the new Browza's!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top