This class can generate PHP scripts that are MySQL backups. It connects to a given MySQL server and extracts the list of all databases. The class generates a PHP script with commands to execute queries that recreate the database tables and insert the records with the current values. The generated backup PHP script is stored in a given file.
Source: Github, Hotscripts, SourceForge