Re: MySQL Dump
| From: | Jordi Canals | Date: | Sat, 24 Apr 2004 14:03:59 +0000 |
| Subject: | Re: MySQL Dump | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-184520@lists.php.net to get a copy of this message | ||
I just tested it and yes, the Michal function runs on Windows and Linux. Just must write the path in the proper format for the OS you're using.
Regards,
Jordi.
Matt Palermo wrote:
Will this work on both a Windows and Unix server? "Michal Migurski" <mike@teczno.com> wrote in message news:Pine.BSF.4.58.0404221811080.37146@or.pair.com...Is there an easy way to do a mysql dump routine written in php? I basically want to write a function to backup a database and have it create all the neccessary structures and data in the dump. I know phpMyAdmin will do this for me, but I want to write a function to do this incase the server doesn't have phpMyAdmin installed. Any ideas?Why not use the existing mysqldump command-line utility? function mysql_dump($db, $user, $pass) { return shell_exec("/path/to/mysqldump--user={$user} --password={$pass} --complete-insert --add-drop-table {$db}");}