Matteo Mattei

Hello, my name is Matteo Mattei and this is my personal website. I am computer engineer with a long experience in Linux system administration and web software development.

linkedin rss twitter google+ github facebook

How to backup MySQL data and schema in PHP


For a project I am working on, I needed to create a PHP script to export a full MySQL database data and schema. This is probably not the best solution because for these types of things the right tools to use are mysqldump and phpmyadmin but if you need to do it programmatically using only PHP this might help you.

Here below you can find the code I created for this purpose using PHP-PDO:

comments powered by Disqus