I am trying to add a custom function to the back-end of a site I’m working on.
I have a MySql database with multiple tables that I would like to be able to download by clicking a link.
It would also be great if the backup files could be all added to a zip file for downloading as well.
So, in PHP, how can I create copies of all of the database tables (preferably in SQL format) and zip them for downloading?
I’m not sure if the MySql “INTO OUTFILE” method will work on my shared hosting account. The MySql database is on a different server than the files for my site.
Try this code. Some debugging may be required but you will get the idea.
The above code also does not use zip for that you can use the function described below.