How to clone MySQL database schema in PHP06 Feb 2011 Matteo Mattei mysql php
For my client I needed to create a PHP script that can export a full MySQL database schema in another database. This script also need to keep and set constraints.
You only need to configure
$DB_DST_* variables to fit your environment.
Here below you can find the code I created for this purpose:
Update 2016-10-14: The code below has been rewritten using PHP mysqli driver (thanks to Richard Maurer).