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" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]

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}");
}


-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to