I want to setup a button in my content management system where I can save a backup sql file for the table shown on a particular page. I just want it to download the SQL file to my computer if this is possible. I also wanted to know if it’s possible to do the same thing but export as an excel file of the table data.
If it’s easier to just do a backup of the whole database I’d settle for that, I just need to know if it’s possible and what it is I’m looking for to build the script.
Hopefully this makes sense, I’m struggling to know what I need to look for as I don’t know if it’s actually possible. I’m coding in php.
Thanks in advance.
Here’s a small page enabling you to :
BUT
you shouldn’t do that if you care about security.
If you want to do this kind of manipulation I recommend you to use phpMyAdmin instead.
And if you just want to do automatic backups without downloading, you’d better use
cronand themysqldumpcommand. Cron is configured on many servers to do a backup every night.Look at this :
http://www.comentum.com/mysqldump-cron.html
http://www.noupe.com/how-tos/10-ways-to-automatically-manually-backup-mysql-database.html
Well. Here’s the PHP page :