From: "René Fournier" <[EMAIL PROTECTED]> > Right now, I'm using phpMyAdmin to periodically backup/dump a client > MySQL database to a textfile (from which one can simply restore the > database if it ever got corrupted). I'm also working on a super-simple > CMS for the client to use themselves. I would like the client to also > be able to easily "backup" his web site's MySQL database to a textfile > and have that textfile emailed to whatever address he specifies. Sort > of a two step approach: > > Enter email _________ > < Backup and send database > (click) > > I imagine someone somewhere has written a very nice function for doing > this, which might take a few parameters, such as database, destination > email address, etc. The main thing is that the function include > complete inserts, extended inserts, backquotes, etc. > > Anyone have a sweet function like this they wanna share, and in so > doing make the world a better place? :-)
Easiest way to do this is an exec() call to mysqldump, then read the file and include/attach it in the email. Writing something to simulate mysqldump from within PHP would be a waste, imo. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php