Php code to export all database data This code makes a complete dump of the all tables (or just the ones you specified) by making simple sql queries. Usage: Simply modify database credentials and the tables to export. Then run this file and it will create the .sql file.